Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ironium

Package Overview
Dependencies
Maintainers
2
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ironium - npm Package Compare versions

Comparing version 5.0.0-pre2 to 5.0.0

test/schedule/errors_test.js

3

CHANGELOG.md

@@ -10,3 +10,6 @@ # 5.0.0

A scheduled job's time-to-live is equal to its interval. This better matches
expectations on transient error conditions.
# 4.1.3

@@ -13,0 +16,0 @@

@@ -174,3 +174,3 @@ // Essentially cron for scheduling tasks in Node.

// If true, every new job is started automatically. Necessary in case you
// call schedule() after calling start().
// call scheduleJob() after calling start().
this.started = false;

@@ -262,6 +262,7 @@

const schedule = this._schedules.get(jobName);
if (schedule)
if (shouldRunJob(schedule, job))
return schedule._runJob(jobName, time);
else {
debug('No schedule %s, ignoring', jobName);
debug('Ignoring this occurrence of %s', jobName);
return Promise.resolve();

@@ -298,1 +299,20 @@ }

// A scheduled job may be returned to the queue when it fails or times out.
// For recurring jobs, we don't want to run duplicate jobs once the error
// condition is resolved.
// Returns true if the job should be run.
function shouldRunJob(schedule, job) {
if (schedule) {
if (schedule.every) {
const jobTime = +new Date(job.time);
const expiredBy = jobTime + schedule.every;
const isExpired = Date.now() > expiredBy;
return !isExpired;
} else {
// One-offs never expire (i.e. they must be retried until successful).
return true;
}
} else
return false;
}

2

package.json
{
"name": "ironium",
"version": "5.0.0-pre2",
"version": "5.0.0",
"scripts": {

@@ -5,0 +5,0 @@ "lint": "eslint .",

@@ -409,2 +409,6 @@ # [Ironium](https://www.npmjs.com/package/ironium)

Both scheduled and delayed jobs can be tested by mocking `Date`, also known as
time traveling by tools like [TimeKeeper](https://github.com/vesln/timekeeper#timekeeper).
### purgeQueues()

@@ -519,7 +523,7 @@

If you're running in production against an [Iron.io](https://hud.iron.io/), you
If you're running in production against [Iron.io](https://hud.iron.io/), you
need to set `host`, `project_id` and `token` based on your project credentials.
This is the same format as `iron.json`.
By default, Ironium will process 10 jobs concurrently. You can change this value
By default, Ironium will process 50 jobs concurrently. You can change this value
using the `concurrency` option.

@@ -526,0 +530,0 @@

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