diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-07-19 00:50:05 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-07-19 00:50:05 +0200 |
| commit | 64e8c03dea044752bf3f2f228462721fe565f950 (patch) | |
| tree | 41b48b67f69979bfc97be166129ee41c8dcb0c7f /lib/worker/index.js | |
| parent | 11a70bc347587219b2ec7b63cf4a6ff69bb4199b (diff) | |
refactor all the worker stuff
Diffstat (limited to 'lib/worker/index.js')
| -rw-r--r-- | lib/worker/index.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/worker/index.js b/lib/worker/index.js index 52f12e2..6733dd1 100644 --- a/lib/worker/index.js +++ b/lib/worker/index.js @@ -1,15 +1,16 @@ require('dotenv').config() const ipc = require('node-ipc') -const db = require('../db') -const dbFile = db.crud(db.File) const processFiles = require('./processFiles') +const processTask = require('./processTask') ipc.config.id = 'cortexworker' ipc.config.retry = 1500 +ipc.config.silent = true processFiles() +processTask() ipc.connectTo('cortex', () => { ipc.of.cortex.on('connect', () => { @@ -28,8 +29,10 @@ ipc.connectTo('cortex', () => { }) ipc.of.cortex.on('job', (data) => { ipc.log('received job: '.debug, data); + processTask() }) ipc.of.cortex.on('task', (data) => { ipc.log('received task: '.debug, data); + processTask() }) }) |
