cron 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/time.js CHANGED
@@ -70,7 +70,7 @@ function CronTime(luxon) {
70
70
  this.source = source;
71
71
 
72
72
  if (zone) {
73
- const dt = luxon.DateTime.fromObject({ zone: zone });
73
+ const dt = luxon.DateTime.fromObject({}, { zone: zone });
74
74
  if (dt.invalid) {
75
75
  throw new Error('Invalid timezone.');
76
76
  }
@@ -266,8 +266,8 @@ function CronTime(luxon) {
266
266
  // hard stop if the current date is after the expected execution
267
267
  if (Date.now() > timeout) {
268
268
  throw new Error(
269
- `Something went wrong. cron reached maximum iterations.
270
- Please open an issue (https://github.com/kelektiv/node-cron/issues/new) and provide the following string
269
+ `Something went wrong. It took over five seconds to find the next execution time for the cron job.
270
+ Please refer to the canonical issue (https://github.com/kelektiv/node-cron/issues/467) and provide the following string if you would like to help debug:
271
271
  Time Zone: ${zone || '""'} - Cron String: ${this} - UTC offset: ${date.format(
272
272
  'Z'
273
273
  )} - current Date: ${luxon.DateTime.local().toString()}`
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "cron",
3
3
  "description": "Cron jobs for your node",
4
- "version": "2.0.0",
5
- "author": "Nick Campbell <nicholas.j.campbell@gmail.com> (http://github.com/ncb000gt)",
4
+ "version": "2.2.0",
5
+ "author": "Nick Campbell <nicholas.j.campbell@gmail.com> (https://github.com/ncb000gt)",
6
6
  "bugs": {
7
- "url": "http://github.com/kelektiv/node-cron/issues"
7
+ "url": "https://github.com/kelektiv/node-cron/issues"
8
8
  },
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "http://github.com/kelektiv/node-cron.git"
11
+ "url": "https://github.com/kelektiv/node-cron.git"
12
12
  },
13
13
  "main": "lib/cron",
14
14
  "scripts": {
@@ -16,7 +16,7 @@
16
16
  "test": "jest --coverage"
17
17
  },
18
18
  "dependencies": {
19
- "luxon": "^1.23.x"
19
+ "luxon": "^3.2.1"
20
20
  },
21
21
  "devDependencies": {
22
22
  "chai": "~4.2.x",
@@ -329,7 +329,7 @@ describe('crontime', () => {
329
329
  });
330
330
  const cronTime = new cron.CronTime('0 0 * * *');
331
331
  const nextDate = cronTime._getNextDateFrom(currentDate, 'Asia/Amman');
332
- const expectedDate = luxon.DateTime.fromISO('2018-10-26T00:00', {
332
+ const expectedDate = luxon.DateTime.fromISO('2018-10-26T00:00+03:00', {
333
333
  zone: 'Asia/Amman'
334
334
  });
335
335
  expect(nextDate - expectedDate).toEqual(0);