New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

akyuu-schedule

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

akyuu-schedule - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

34

index.js

@@ -14,7 +14,26 @@ /**

this.akyuu = akyuu;
this.logger = akyuu.logger.get('plugin-schedule');
this.position = this.akyuu.PLUGIN_POS.AFTER_CONTROLLER;
this.mode = options.mode;
this.disabledTasks = options.disabledTasks || [];
this.enabledTasks = options.enabledTasks || [];
}
_isEnabled(name) {
const mode = this.mode;
const disabledTasks = this.disabledTasks;
const enabledTasks = this.enabledTasks;
if(mode === 'blacklist') {
return disabledTasks.indexOf(name) < 0;
} else if(mode === 'whiteList') {
return enabledTasks.indexOf(name) > -1;
} else {
return true;
}
}
plug() {
const dir = path.join(this.akyuu.config.server.root, 'scheduled');
const _this = this;
const dir = path.join(_this.akyuu.config.server.root, 'scheduled');
let fileList = [];

@@ -43,7 +62,16 @@ try {

schedule.scheduleJob(task.plan, task.job);
if (!_this._isEnabled(path.parse(file).name)) continue;
schedule.scheduleJob(task.plan, function() {
task.job(function(error) {
if(error) {
_this.logger.error('run schedule job error');
_this.logger.error(error.stack);
}
});
});
}
if(fileList.length === 0) {
console.log('no task');
_this.logger.info('no schedule job');
}

@@ -50,0 +78,0 @@ }

4

package.json
{
"name": "akyuu-schedule",
"version": "0.1.1",
"version": "0.1.2",
"description": "schedule plug in for akyuu",

@@ -25,2 +25,2 @@ "main": "index.js",

}
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc