TimeStampBuddy / app.py
Mihaiii's picture
Update app.py
466eeae verified
raw
history blame
341 Bytes
import subprocess
from fastapi import FastAPI
from concurrent.futures import ThreadPoolExecutor
app = FastAPI()
def start_worker():
subprocess.run(["python3", "TimeStampBuddy/cron_processor.py"])
executor = ThreadPoolExecutor(max_workers=1)
executor.submit(start_worker)
@app.get("/")
def greet_json():
return {"Hello": "World!"}