Spaces:
Running
Running
Commit
·
c791eda
1
Parent(s):
d6979e5
fix a bug in app.py: empty logs file list
Browse files
app.py
CHANGED
@@ -17,6 +17,8 @@ def restart_space():
|
|
17 |
|
18 |
|
19 |
def get_log_files():
|
|
|
|
|
20 |
return sorted([f for f in os.listdir(LOG_DIR) if f.endswith('.log')])
|
21 |
|
22 |
|
@@ -32,6 +34,8 @@ def display_log_content(selected_file):
|
|
32 |
|
33 |
|
34 |
if __name__ == "__main__":
|
|
|
|
|
35 |
process = multiprocessing.Process(
|
36 |
target=pull_search_results,
|
37 |
args=(
|
|
|
17 |
|
18 |
|
19 |
def get_log_files():
|
20 |
+
if not os.path.exists(LOG_DIR):
|
21 |
+
return []
|
22 |
return sorted([f for f in os.listdir(LOG_DIR) if f.endswith('.log')])
|
23 |
|
24 |
|
|
|
34 |
|
35 |
|
36 |
if __name__ == "__main__":
|
37 |
+
os.makedirs(LOG_DIR, exist_ok=True)
|
38 |
+
|
39 |
process = multiprocessing.Process(
|
40 |
target=pull_search_results,
|
41 |
args=(
|