Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added the opposition party worker. and the subtract job
- Loading branch information
Showing
4 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
var fs = require('fs'), | ||
sys = require('sys'), | ||
path = require('path'), | ||
config = require('../config/initialize'), | ||
Logger = require('../lib/log').Logger, | ||
ResqueJobs = require('../lib/jobs').ResqueJobs, | ||
resque = require('../node_modules/coffee-resque').connect(), | ||
_ = require('../node_modules/underscore'); | ||
|
||
var log = new Logger(); | ||
|
||
/* | ||
* resque takes the entire function out and runs it | ||
* functions need to be self-contained | ||
*/ | ||
var workerJobs = { | ||
addHDBValue: function(value, callback) { | ||
var jobs = new ResqueJobs(); | ||
jobs.addHDBValue(value, callback); | ||
}, | ||
|
||
subtractHDBValue: function(value, callback) { | ||
var jobs = new ResqueJobs(); | ||
jobs.subtractHDBValue(value, callback); | ||
} | ||
}; | ||
|
||
try { | ||
var opposition = require('coffee-resque') | ||
.connect({timeout: 500}) | ||
.worker('high', workerJobs); | ||
|
||
opposition.start(); | ||
} catch (err) { | ||
opposition.end(); | ||
opposition.start(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters