Spaces:
Sleeping
Sleeping
File size: 531 Bytes
16e04bc 7c51cec 0a9e54c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
from dotenv import load_dotenv
import logging
from concurrent.futures import ThreadPoolExecutor
from cron_processor import main
def start_worker():
load_dotenv()
logging.basicConfig(
format='%(asctime)s - %(levelname)s - %(message)s',
level=logging.INFO,
datefmt='%Y-%m-%d %H:%M:%S'
)
asyncio.run(main())
executor = ThreadPoolExecutor(max_workers=1)
executor.submit(start_worker)
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def greet_json():
return {"Hello": "World!"} |