update timer

This commit is contained in:
MuslemRahimi 2024-08-28 20:44:08 +02:00
parent 3cea1b06bc
commit 61f9588652
2 changed files with 5 additions and 3 deletions

View File

@ -57,10 +57,11 @@ def run_command(command):
if stderr:
logger.error("Error:\n" + stderr)
def run_json_job():
def run_json():
# Run the asynchronous function inside an asyncio loop
run_command(["python3", "restart_json.py"])
run_command(["pm2", "restart","fastapi"])
run_command(["pm2", "restart","fastify"])
def run_pocketbase():
# Run the asynchronous function inside an asyncio loop
@ -596,7 +597,7 @@ schedule.every(15).minutes.do(run_threaded, run_market_moods).tag('market_moods_
#schedule.every(10).minutes.do(run_threaded, run_dark_pool_flow).tag('dark_pool_flow_job')
schedule.every(2).hours.do(run_threaded, run_fda_calendar).tag('fda_calendar_job')
schedule.every(3).hours.do(run_threaded, run_json_job).tag('json_job')
schedule.every(2).hours.do(run_threaded, run_json).tag('json_job')
#schedule.every(4).hours.do(run_threaded, run_share_statistics).tag('share_statistics_job')
schedule.every(6).hours.do(run_threaded, run_analyst_rating).tag('analyst_job')

View File

@ -33,6 +33,7 @@ def run_json_job():
# Run the asynchronous function inside an asyncio loop
subprocess.run(["python3", "restart_json.py"])
subprocess.run(["pm2", "restart","fastapi"])
subprocess.run(["pm2", "restart","fastify"])
# Create functions to run each schedule in a separate thread
@ -42,7 +43,7 @@ def run_threaded(job_func):
schedule.every().day.at("15:45").do(run_threaded, run_restart_cache)
schedule.every(3).hours.do(run_threaded, run_json_job).tag('json_job')
schedule.every(2).hours.do(run_threaded, run_json_job).tag('json_job')
while True:
schedule.run_pending()