Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Add upstart tasks for cron jobs.
Browse files Browse the repository at this point in the history
  • Loading branch information
spladug committed May 31, 2012
1 parent 1c1863e commit 2028bc4
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 0 deletions.
11 changes: 11 additions & 0 deletions upstart/reddit-job-broken_things.conf
@@ -0,0 +1,11 @@
description "find and delete new broken things (usually caused by failed transactions)"

manual
task

nice 10

script
. /etc/default/reddit
wrap-job paster run $REDDIT_INI -c 'from r2.lib.utils import utils; utils.find_recent_broken_things(delete=True)'
end script
11 changes: 11 additions & 0 deletions upstart/reddit-job-clean_up_hardcache.conf
@@ -0,0 +1,11 @@
description "remove expired tokens from hardcache"

manual
task

nice 10

script
. /etc/default/reddit
wrap-job paster run $REDDIT_INI -c 'from r2.lib.hardcachebackend import delete_expired; delete_expired()'
end script
11 changes: 11 additions & 0 deletions upstart/reddit-job-email.conf
@@ -0,0 +1,11 @@
description "send queued emails"

manual
task

nice 10

script
. /etc/default/reddit
wrap-job paster run $REDDIT_INI -c 'from r2.lib import emailer; emailer.send_queued_mail()'
end script
11 changes: 11 additions & 0 deletions upstart/reddit-job-google_checkout.conf
@@ -0,0 +1,11 @@
description "process uncharged google checkout transactions (gold)"

manual
task

nice 10

script
. /etc/default/reddit
wrap-job paster run $REDDIT_INI -c 'from r2.models import gold; gold.process_uncharged()'
end script
11 changes: 11 additions & 0 deletions upstart/reddit-job-rising.conf
@@ -0,0 +1,11 @@
description "update the rising pages"

task
manual

nice 10

script
. /etc/default/reddit
wrap-job paster run $REDDIT_INI -c 'from r2.lib import rising; rising.set_rising()'
end script
13 changes: 13 additions & 0 deletions upstart/reddit-job-solrsearch.conf
@@ -0,0 +1,13 @@
description "commit/optimize solr index"

instance $optimize

manual
task

nice 10

script
. /etc/default/reddit
wrap-job paster run $REDDIT_INI -c "from r2.lib import solrsearch; solrsearch.run_commit(optimize=$optimize)"
end script
11 changes: 11 additions & 0 deletions upstart/reddit-job-update_gold_users.conf
@@ -0,0 +1,11 @@
description "trigger notification of impending expiration or actual expiration for gold membership"

manual
task

nice 10

script
. /etc/default/reddit
wrap-job paster run $REDDIT_INI -c 'from r2.models import update_gold_users; update_gold_users(verbose=True)'
end script
11 changes: 11 additions & 0 deletions upstart/reddit-job-update_promos.conf
@@ -0,0 +1,11 @@
description "update promoted link listings"

manual
task

nice 10

script
. /etc/default/reddit
wrap-job paster run $REDDIT_INI -c 'from r2.lib import promote; promote.Run()'
end script
11 changes: 11 additions & 0 deletions upstart/reddit-job-update_reddits.conf
@@ -0,0 +1,11 @@
description "update /reddits sort scores"

manual
task

nice 10

script
. /etc/default/reddit
wrap-job paster run $REDDIT_INI -c 'from r2.lib import sr_pops; sr_pops.run()'
end script
11 changes: 11 additions & 0 deletions upstart/reddit-job-update_sr_names.conf
@@ -0,0 +1,11 @@
description "update the subreddit name search cache"

manual
task

nice 10

script
. /etc/default/reddit
wrap-job paster run $REDDIT_INI -c 'from r2.lib import subreddit_search; subreddit_search.load_all_reddits()'
end script

0 comments on commit 2028bc4

Please sign in to comment.