WiP on permissions

Doesn't run. This commit is just to backup the changes.
This commit is contained in:
Tomas Bures 2017-07-26 22:42:05 +03:00
parent 5df444f641
commit 89c9615592
37 changed files with 913 additions and 366 deletions

View file

@ -3,6 +3,7 @@
const log = require('npmlog');
const reports = require('../models/reports');
const executor = require('./executor');
const contextHelpers = require('../lib/context-helpers');
let runningWorkersCount = 0;
let maxWorkersCount = 1;
@ -99,7 +100,7 @@ async function tryStartWorkers() {
isStartingWorkers = false;
}
module.exports.start = async reportId => {
module.exports.start = async (reportId) => {
if (!workers[reportId]) {
log.info('ReportProcessor', 'Scheduling report id: %s', reportId);
await reports.updateFields(reportId, { state: reports.ReportState.SCHEDULED, last_run: null});