-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
151 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
# Configure logging | ||
log() { | ||
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | ||
} | ||
|
||
run_discord_gpt4o() { | ||
while true; do | ||
log "INFO - Starting discord_gpt4o script..." | ||
python3 discord_gpt4o.py 2>&1 | while IFS= read -r line; do | ||
echo "$line" | ||
if echo "$line" | grep -qE "Unknown ssrc|error|Traceback \(most recent call last\):"; then | ||
log "WARNING - Detected 'Unknown ssrc', error, or error trace in output. Restarting..." | ||
pkill -f "python3 discord_gpt4o.py" | ||
break | ||
fi | ||
done | ||
|
||
if [ $? -ne 0 ]; then | ||
log "ERROR - discord_gpt4o encountered an error or needs restart. Restarting..." | ||
else | ||
log "INFO - discord_gpt4o finished successfully. Restarting..." | ||
fi | ||
|
||
log "INFO - Waiting for 5 seconds before restarting..." | ||
sleep 5 | ||
done | ||
} | ||
|
||
log "INFO - Starting run_discord_gpt4o script" | ||
run_discord_gpt4o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
# Configure logging | ||
log() { | ||
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | ||
} | ||
|
||
run_discord_gpt4o() { | ||
while true; do | ||
log "INFO - Starting discord_gpt4o script..." | ||
python3 discord_gpt4o.py 2>&1 | while IFS= read -r line; do | ||
echo "$line" | ||
if echo "$line" | grep -qE "Unknown ssrc|error|Traceback \(most recent call last\):"; then | ||
log "WARNING - Detected 'Unknown ssrc', error, or error trace in output. Restarting..." | ||
pkill -f "python3 discord_gpt4o.py" | ||
break | ||
fi | ||
done | ||
|
||
if [ $? -ne 0 ]; then | ||
log "ERROR - discord_gpt4o encountered an error or needs restart. Restarting..." | ||
else | ||
log "INFO - discord_gpt4o finished successfully. Restarting..." | ||
fi | ||
|
||
log "INFO - Waiting for 5 seconds before restarting..." | ||
sleep 5 | ||
done | ||
} | ||
|
||
log "INFO - Starting run_discord_gpt4o script" | ||
run_discord_gpt4o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters