Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import asyncio
|
2 |
+
from concurrent.futures import ThreadPoolExecutor
|
3 |
+
from cron_processor import main
|
4 |
+
|
5 |
+
def start_worker():
|
6 |
+
load_dotenv()
|
7 |
+
logging.basicConfig(
|
8 |
+
format='%(asctime)s - %(levelname)s - %(message)s',
|
9 |
+
level=logging.INFO,
|
10 |
+
datefmt='%Y-%m-%d %H:%M:%S'
|
11 |
+
)
|
12 |
+
asyncio.run(main())
|
13 |
+
|
14 |
+
executor = ThreadPoolExecutor(max_workers=1)
|
15 |
+
executor.submit(start_worker)
|