diff --git a/lib/app/index.js b/lib/app/index.js index 46ab312..4dd2a6f 100644 --- a/lib/app/index.js +++ b/lib/app/index.js @@ -98,7 +98,7 @@ App.prototype.listArticles = function(userId, n, fresh) { return this.Article.list(userId, n, fresh); }; -App.prototype.startScraping = function() { +App.prototype.listenForJobs = function() { this.connections.queue.handle(SCRAPE_QUEUE, this.handleScrapeJob.bind(this)); this.connections.queue.handle(VOTE_QUEUE, this.handleVoteJob.bind(this)); return this; diff --git a/lib/server.js b/lib/server.js index 310cde3..8359361 100644 --- a/lib/server.js +++ b/lib/server.js @@ -25,7 +25,7 @@ function start() { instance.on('lost', abort); function createServer() { - if (config.thrifty) instance.startScraping(); + if (config.thrifty) instance.listenForJobs(); var server = http.createServer(web(instance, config)); process.on('SIGTERM', shutdown); diff --git a/lib/worker.js b/lib/worker.js index 25e100f..862188c 100644 --- a/lib/worker.js +++ b/lib/worker.js @@ -22,7 +22,7 @@ function start() { function beginWork() { instance.on('lost', shutdown); - instance.startScraping(); + instance.listenForJobs(); } function shutdown() { diff --git a/readme.md b/readme.md index 0174b69..6330305 100644 --- a/readme.md +++ b/readme.md @@ -39,8 +39,8 @@ cd node-articles-nlp heroku create -heroku addons:add mongohq -heroku addons:add cloudamqp +heroku addons:create mongohq +heroku addons:create cloudamqp heroku config:set NODE_ENV=production heroku config:set VIEW_CACHE=true