Commit
·
28e9187
1
Parent(s):
bfb27a7
Handle the error when no log file
Browse files
app.py
CHANGED
|
@@ -11,8 +11,11 @@ LOG_FILE = "output.log"
|
|
| 11 |
|
| 12 |
def read_logs():
|
| 13 |
sys.stdout.flush()
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
|
| 18 |
previous_url = ""
|
|
|
|
| 11 |
|
| 12 |
def read_logs():
|
| 13 |
sys.stdout.flush()
|
| 14 |
+
try:
|
| 15 |
+
with open(LOG_FILE, "r") as f:
|
| 16 |
+
return f.read()
|
| 17 |
+
except Exception:
|
| 18 |
+
return "ML worker not running"
|
| 19 |
|
| 20 |
|
| 21 |
previous_url = ""
|