Add upstart tasks for cron jobs.

This commit is contained in:
Neil Williams
2012-05-30 16:15:25 -07:00
parent 1c1863e464
commit 2028bc4418
10 changed files with 112 additions and 0 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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