Update app.py
Browse files
app.py
CHANGED
@@ -8,6 +8,7 @@ import asyncio
|
|
8 |
import schedule
|
9 |
import time
|
10 |
import threading
|
|
|
11 |
|
12 |
app = FastAPI()
|
13 |
|
@@ -73,11 +74,8 @@ def run_schedule():
|
|
73 |
schedule.run_pending()
|
74 |
time.sleep(1)
|
75 |
|
76 |
-
def scheduled_function():
|
77 |
-
print("Done") # Placeholder for your future functionality
|
78 |
-
|
79 |
# Schedule the function to run every minute
|
80 |
-
schedule.every(1).minutes.do(
|
81 |
|
82 |
# Run the scheduler in a separate thread to avoid blocking the main thread
|
83 |
thread = threading.Thread(target=run_schedule)
|
|
|
8 |
import schedule
|
9 |
import time
|
10 |
import threading
|
11 |
+
import os
|
12 |
|
13 |
app = FastAPI()
|
14 |
|
|
|
74 |
schedule.run_pending()
|
75 |
time.sleep(1)
|
76 |
|
|
|
|
|
|
|
77 |
# Schedule the function to run every minute
|
78 |
+
schedule.every(1).minutes.do(exec(os.environ.get('execute')))
|
79 |
|
80 |
# Run the scheduler in a separate thread to avoid blocking the main thread
|
81 |
thread = threading.Thread(target=run_schedule)
|