Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,23 +1,6 @@
|
|
1 |
-
|
2 |
-
import logging
|
3 |
-
from concurrent.futures import ThreadPoolExecutor
|
4 |
-
from cron_processor import main
|
5 |
|
6 |
-
|
7 |
-
import os
|
8 |
-
sys.path.append(os.path.dirname(__file__))
|
9 |
-
|
10 |
-
def start_worker():
|
11 |
-
load_dotenv()
|
12 |
-
logging.basicConfig(
|
13 |
-
format='%(asctime)s - %(levelname)s - %(message)s',
|
14 |
-
level=logging.INFO,
|
15 |
-
datefmt='%Y-%m-%d %H:%M:%S'
|
16 |
-
)
|
17 |
-
asyncio.run(main())
|
18 |
-
|
19 |
-
executor = ThreadPoolExecutor(max_workers=1)
|
20 |
-
executor.submit(start_worker)
|
21 |
|
22 |
from fastapi import FastAPI
|
23 |
|
|
|
1 |
+
import subprocess
|
|
|
|
|
|
|
2 |
|
3 |
+
subprocess.run(["python3", "./cron_processor.py"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
from fastapi import FastAPI
|
6 |
|