Add queue consumer upstart jobs.

This commit is contained in:
Neil Williams
2012-05-31 15:26:21 -07:00
parent da3bd2ee69
commit 28cf919800
7 changed files with 90 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
description "update the cloudsearch index with new/changed documents"
instance $x
stop on runlevel [016]
respawn
respawn limit 10 5
nice 10
script
. /etc/default/reddit
wrap-job paster run --proctitle cloudsearch_q$x $REDDIT_INI $REDDIT_ROOT/r2/lib/cloudsearch.py -c 'run_changed()'
end script

View File

@@ -0,0 +1,14 @@
description "place new comments in the precomputed comment trees"
instance $x
stop on runlevel [016]
respawn
respawn limit 10 5
nice 10
script
. /etc/default/reddit
wrap-job paster run --proctitle commentstree_q$x $REDDIT_INI $REDDIT_ROOT/r2/lib/db/queries.py -c 'run_commentstree()'
end script

View File

@@ -0,0 +1,14 @@
description "consume log messages from log_q (including exception tracebacks)"
instance $x
stop on runlevel [016]
respawn
respawn limit 10 5
nice 10
script
. /etc/default/reddit
wrap-job paster run --proctitle log_q$x $REDDIT_INI $REDDIT_ROOT/../scripts/log_q.py -c 'run(verbose=True)'
end script

View File

@@ -0,0 +1,14 @@
description "newcomments_q - update the /comments pages"
instance $x
stop on runlevel [016]
respawn
respawn limit 10 5
nice 10
script
. /etc/default/reddit
wrap-job paster run --proctitle newcomments_q$x $REDDIT_INI $REDDIT_ROOT/r2/lib/db/queries.py -c 'run_new_comments()'
end script

View File

@@ -0,0 +1,14 @@
description "find thumbnails/embedded content for newly submitted links"
instance $x
stop on runlevel [016]
respawn
respawn limit 10 5
nice 10
script
. /etc/default/reddit
wrap-job paster run --proctitle scraper_q$x $REDDIT_INI $REDDIT_ROOT/r2/lib/media.py -c 'run()'
end script

View File

@@ -0,0 +1,10 @@
description "restart queue consumers"
task
start on reddit-restart or reddit-kill
script
. /etc/default/reddit
manage-consumers
end script

View File

@@ -0,0 +1,10 @@
description "start up queue consumers"
task
start on runlevel [2345] or reddit-start
script
. /etc/default/reddit
manage-consumers
end script