paola1 commited on
Commit
e3ab05d
·
verified ·
1 Parent(s): 884a5ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
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(scheduled_function)
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)