Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
agenda-batch
Advanced tools
A batching tool for the agenda.js tool that will proxy data to a task that has not been run.
Initialize the library:
var Agenda = require('agenda');
var Batch = require('batch');
var agenda = new Agenda({ db: { address: 'db-connection:24717' } });
batch = new Batch( agenda );
Define jobs using the agenda module:
agenda.define('email-some-users', function(err, cb) {
// Do Something
});
Batch a process by calling the batch function.
batch.batch('batch-key', { data }, 'in 40 minutes', 'email-some-users');
Subsequent calls to the batch function will add data to the original waiting job. Important note. The timing of existing jobs will not be reset. The purpose of the function is to be able to send additional data to jobs in the queue without having to care when they will fire.
batch.batch('batch-key', { MORE-data }, 'in 40 minutes', 'job-name');
In the callback, the data will be found in the attrs.data.jobData
attribute.
batch.define('job-name', function(job) {
job.attrs.data.jobData // Will be an array of the data that was 'batched'.
job.attrs.data.key // The key used to store this batch for this job.
});
Once the job is complete, the key will be abandoned and the job removed for the next job to use (on subsequent calls to batch()
);
Take a look at lib/cli, or run it via npm run cli
to see an example. Requires a mongo instance for agenda to run.
FAQs
A batch process for the agenda module
We found that agenda-batch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.