File size: 341 Bytes
8efce19
0a9e54c
466eeae
0a9e54c
 
 
466eeae
 
 
 
 
 
0a9e54c
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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!"}