Added an API endpoint that triggers an RSS campaign.

This commit is contained in:
Tomas Bures 2018-12-29 15:12:42 +01:00
parent e786964411
commit 428fb9db7b
8 changed files with 88 additions and 7 deletions

View file

@ -5,10 +5,12 @@ const log = require('./log');
const path = require('path');
const senders = require('./senders');
let messageTid = 0;
let feedcheckProcess;
module.exports = {
spawn
spawn,
scheduleCheck
};
function spawn(callback) {
@ -34,3 +36,13 @@ function spawn(callback) {
log.error('Feed', 'Feedcheck process exited with code %s signal %s', code, signal);
});
}
function scheduleCheck() {
feedcheckProcess.send({
type: 'scheduleCheck',
tid: messageTid
});
messageTid++;
}