This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Add queue consumer upstart jobs.

  • Loading branch information...
1 parent da3bd2e commit 28cf919800ed6d293bfb117c4205bea14386f454 @spladug spladug committed May 31, 2012
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -0,0 +1,10 @@
+description "restart queue consumers"
+
+task
+
+start on reddit-restart or reddit-kill
+
+script
+ . /etc/default/reddit
+ manage-consumers
+end script
@@ -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

0 comments on commit 28cf919

Please sign in to comment.