Actual fix -- MOVED TO TEMPLATE
This commit is contained in:
+1
-5
@@ -417,11 +417,7 @@ class Backend:
|
|||||||
|
|
||||||
async def tail_log():
|
async def tail_log():
|
||||||
log.debug(f"tailing file: {self.model_log_file}")
|
log.debug(f"tailing file: {self.model_log_file}")
|
||||||
async with await open_file(self.model_log_file, mode="r", encoding='utf-8', errors='ignore') as f:
|
async with await open_file(self.model_log_file, encoding='utf-8', errors='ignore') as f:
|
||||||
try:
|
|
||||||
await f.seek(0)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
while True:
|
while True:
|
||||||
line = await f.readline()
|
line = await f.readline()
|
||||||
if line:
|
if line:
|
||||||
|
|||||||
@@ -124,9 +124,5 @@ cd "$SERVER_DIR"
|
|||||||
|
|
||||||
echo "launching PyWorker server"
|
echo "launching PyWorker server"
|
||||||
|
|
||||||
# if instance is rebooted, we want to clear out the log file so pyworker doesn't read lines
|
|
||||||
# from the run prior to reboot. past logs are saved in $MODEL_LOG.old for debugging only
|
|
||||||
[ -e "$MODEL_LOG" ] && cat "$MODEL_LOG" >> "$MODEL_LOG.old" && : > "$MODEL_LOG"
|
|
||||||
|
|
||||||
(python3 -m "workers.$BACKEND.server" |& tee -a "$PYWORKER_LOG") &
|
(python3 -m "workers.$BACKEND.server" |& tee -a "$PYWORKER_LOG") &
|
||||||
echo "launching PyWorker server done"
|
echo "launching PyWorker server done"
|
||||||
|
|||||||
Reference in New Issue
Block a user