all files / dist/config/ tasks.js

100% Statements 5/5
100% Branches 0/0
100% Functions 2/2
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109                18×                                                                                                                                                                               18×                  
'use strict';
 
Object.defineProperty(exports, "__esModule", {
  value: true
});
/**
 * Default task configs.
 */
exports.default = {
  tasks: function tasks(api) {
    return {
      // ---------------------------------------------------------------------
      // should this mode run a scheduler to promote delayed tasks?
      // ---------------------------------------------------------------------
      scheduler: false,
 
      // ---------------------------------------------------------------------
      // what queues should the taskProcessors work?
      // ---------------------------------------------------------------------
      queues: ['*'],
 
      // ---------------------------------------------------------------------
      // logging levels of tasks workers
      // ---------------------------------------------------------------------
      workerLogging: {
        failure: 'error', // task failure
        success: 'info', // task success
        start: 'info',
        end: 'info',
        cleaning_worker: 'info',
        poll: 'debug',
        job: 'debug',
        pause: 'debug',
        internalError: 'error',
        multiWorkerAction: 'debug'
      },
 
      // ---------------------------------------------------------------------
      // logging levels of the task scheduler
      // ---------------------------------------------------------------------
      schedulerLogging: {
        start: 'info',
        end: 'info',
        poll: 'debug',
        enqueue: 'debug',
        reEnqueue: 'debug',
        working_timestamp: 'debug',
        transferred_job: 'debug'
      },
 
      // ---------------------------------------------------------------------
      // how long to sleep between jobs / scheduler checks
      // ---------------------------------------------------------------------
      timeout: 5000,
 
      // ---------------------------------------------------------------------
      // at minimum, how many parallel taskProcessors should this node spawn?
      // (have number > 0 to enable, and < 1 to disable)
      // ---------------------------------------------------------------------
      minTaskProcessors: 0,
 
      // ---------------------------------------------------------------------
      // at maximum, how many parallel taskProcessors should this node spawn?
      // ---------------------------------------------------------------------
      maxTaskProcessors: 0,
 
      // ---------------------------------------------------------------------
      // how often should we check the event loop to spawn more taskProcessors?
      // ---------------------------------------------------------------------
      checkTimeout: 500,
 
      // ---------------------------------------------------------------------
      // how many ms would constitute an event loop delay to halt
      // taskProcessors spawning?
      // ---------------------------------------------------------------------
      maxEventLoopDelay: 5,
 
      // ---------------------------------------------------------------------
      // When we kill off a taskProcessor, should we disconnect that local
      // redis connection?
      // ---------------------------------------------------------------------
      toDisconnectProcessors: true,
 
      // ---------------------------------------------------------------------
      // What redis server should we connect to for tasks / delayed jobs?
      // ---------------------------------------------------------------------
      redis: api.config.redis
    };
  }
};
 
/**
 * Tasks configs for test environment.
 *
 * @type {{tasks: (function())}}
 */
 
var test = exports.test = {
  tasks: function tasks(api) {
    return {
      timeout: 100,
      checkTimeout: 50,
      scheduler: true,
      redis: api.config.redis
    };
  }
};
//# sourceMappingURL=tasks.js.map