Skip to content

Commit

Permalink
update prime cron job
Browse files Browse the repository at this point in the history
  • Loading branch information
MuslemRahimi committed Feb 3, 2025
1 parent 52709e1 commit 2f8a9c8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/primary_cron_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,15 @@ def run_ai_score():
run_command(["python3", "restart_json.py"])
run_command(["python3", "cron_statistics.py"])

def run_push_notification():
now = datetime.now(ny_tz)
week = now.weekday()
hour = now.hour

if week <= 4 and 7 <= hour < 22:
run_command(["python3", "cron_push_notification.py"])


# Create functions to run each schedule in a separate thread
def run_threaded(job_func):
job_thread = threading.Thread(target=job_func)
Expand Down Expand Up @@ -413,6 +422,7 @@ def run_threaded(job_func):
schedule.every(3).hours.do(run_threaded, run_press_releases).tag('press_release_job')


schedule.every(15).minutes.do(run_threaded, run_push_notification).tag('push_notification_job')
schedule.every(30).minutes.do(run_threaded, run_options_stats).tag('options_stats_job')

schedule.every(5).minutes.do(run_threaded, run_market_flow).tag('market_flow_job')
Expand Down

0 comments on commit 2f8a9c8

Please sign in to comment.