Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions gaianet
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,25 @@ update_config() {

# * start subcommand

# Added by Aboyeji Isaac:
# stop_force() and store_force() were missing but called inside start_chat_server().
# These helper functions prevent crashes by force-stopping processes and saving logs.

stop_force() {
echo "🛑 Forcing stop of chat server..."
pkill -9 wasmedge || true # kill any leftover chat server process
rm -f "$gaianet_base_dir/chat_server.pid"
}

store_force() {
echo "💾 Forcing store of chat server logs/state..."
# For now, just move logs so they are preserved
timestamp=$(date +"%Y%m%d_%H%M%S")
if [ -f "$log_dir/chat-server.log" ]; then
cp "$log_dir/chat-server.log" "$log_dir/chat-server_$timestamp.log"
fi
}

start_chat_server() {
# parse cli options for chat model
url_chat_model=$(awk -F'"' '/"chat":/ {print $4}' $gaianet_base_dir/config.json)
Expand Down
Loading