Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(config, listener) {
this.config = config;
this.queue = new Queue();
this.scheduler = new Scheduler();
this.prefix = config.treeherderTaskcluster.routePrefix;
this.listener = listener;
// Treeherder project instances used for posting job details to treeherder
this.projects = {}
listener.on('message', (message) => {
return this.handleTaskEvent(message);
});
// Pending pushes per repository...
this._pendingPushes = {
/**
example: {
active: false,
cfg.get('influx:connectionString'),
cfg.get('influx:maxDelay'),
cfg.get('influx:maxPendingPoints')
);
} catch(e) {
debug("Missing influx_connectionStraing: stats collection disabled.");
var statsDrain = common.stdoutStatsDrain;
}
// For use in validation of taskcluster github config files
let validator = await common.buildValidator(cfg);
// Create a single connection to the GithubAPI to pass around
var githubAPI = new Octokat(cfg.get('github:credentials'));
var scheduler = new taskcluster.Scheduler(cfg.get('taskcluster'));
// A context to be passed into message handlers
let context = {cfg, githubAPI, scheduler, validator};
// Start monitoring the process
base.stats.startProcessUsageReporting({
drain: statsDrain,
component: cfg.get('taskclusterGithub:statsComponent'),
process: 'worker'
});
let pulseCredentials = cfg.get('pulse')
assert(pulseCredentials.username, 'Username must be supplied for pulse connection');
assert(pulseCredentials.password, 'Password must be supplied for pulse connection');
var webHookListener = new taskcluster.PulseListener({