Spaces:
Running
Running
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() | |
def greet_json(): | |
return {"Hello": "World!"} |