Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
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
The npm package agenda-batch receives a total of 1 weekly downloads. As such, agenda-batch popularity was classified as not popular.
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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.