Skip to content

Commit

Permalink
add reddit tracker cron job
Browse files Browse the repository at this point in the history
  • Loading branch information
MuslemRahimi committed Jul 27, 2024
1 parent ba91246 commit c9d6018
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/primary_cron_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,16 @@ def run_dashboard():
]
run_command(command)

def run_reddit_tracker():
run_command(["python3", "cron_reddit_tracker.py"])
run_command(["python3", "cron_reddit_statistics.py"])
command = [
"sudo", "rsync", "-avz", "-e", "ssh",
"/root/backend/app/json/reddit-tracker",
f"root@{useast_ip_address}:/root/backend/app/json"
]
run_command(command)

# 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 @@ -463,6 +473,9 @@ def run_threaded(job_func):
schedule.every(10).minutes.do(run_threaded, run_one_day_price).tag('one_day_price_job')
schedule.every(15).minutes.do(run_threaded, run_cron_heatmap).tag('heatmap_job')

schedule.every(30).minutes.do(run_threaded, run_reddit_tracker).tag('reddit_tracker_job')


schedule.every(1).minutes.do(run_threaded, run_cron_quote).tag('quote_job')
schedule.every(1).minutes.do(run_threaded, run_cron_price_alert).tag('price_alert_job')
schedule.every(15).minutes.do(run_threaded, run_market_moods).tag('market_moods_job')
Expand Down

0 comments on commit c9d6018

Please sign in to comment.