cron 3.1.5 → 3.1.6
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/CHANGELOG.md +23 -0
- package/dist/job.d.ts +1 -1
- package/dist/job.js +6 -3
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
## [3.1.6](https://github.com/kelektiv/node-cron/compare/v3.1.5...v3.1.6) (2023-10-29)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### 🐛 Bug Fixes
|
|
5
|
+
|
|
6
|
+
* revert runOnce breaking changes ([#760](https://github.com/kelektiv/node-cron/issues/760)) ([7cb53ec](https://github.com/kelektiv/node-cron/commit/7cb53ec9944b19ed5ba92b2466e73fc158ef1d11))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### ⚙️ Continuous Integrations
|
|
10
|
+
|
|
11
|
+
* **action:** update actions/checkout action to v4 ([#755](https://github.com/kelektiv/node-cron/issues/755)) ([d0d70c6](https://github.com/kelektiv/node-cron/commit/d0d70c67532b9a2563ed7a4273901f85b314d1b9))
|
|
12
|
+
* **action:** update github/codeql-action action to v2.22.4 ([#752](https://github.com/kelektiv/node-cron/issues/752)) ([04454c3](https://github.com/kelektiv/node-cron/commit/04454c34a5cbfcffb6938173393380840a7c8d75))
|
|
13
|
+
* **action:** update github/codeql-action action to v2.22.5 ([#758](https://github.com/kelektiv/node-cron/issues/758)) ([2dff183](https://github.com/kelektiv/node-cron/commit/2dff1838a6b8ee400ad721c7a41065ee73a42b8a))
|
|
14
|
+
* **action:** update ossf/scorecard-action action to v2.3.1 ([#754](https://github.com/kelektiv/node-cron/issues/754)) ([41d21f1](https://github.com/kelektiv/node-cron/commit/41d21f16b58dc76e48c81751c8782b6c6c1ac7ca))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### ♻️ Chores
|
|
18
|
+
|
|
19
|
+
* **deps:** update dependency [@commitlint](https://github.com/commitlint)/cli to v18.2.0 ([#759](https://github.com/kelektiv/node-cron/issues/759)) ([4cb466e](https://github.com/kelektiv/node-cron/commit/4cb466e183016861098cb4252b48cb54fb0ea96d))
|
|
20
|
+
* **deps:** update dependency [@types](https://github.com/types)/node to v20.8.8 ([#756](https://github.com/kelektiv/node-cron/issues/756)) ([361728e](https://github.com/kelektiv/node-cron/commit/361728ebf8bc6a3202001fccaf6661e9417054a1))
|
|
21
|
+
* **deps:** update dependency [@types](https://github.com/types)/node to v20.8.9 ([#757](https://github.com/kelektiv/node-cron/issues/757)) ([e2b1bac](https://github.com/kelektiv/node-cron/commit/e2b1bac21b59b9bd02a9000ec1c885961d07e121))
|
|
22
|
+
* **deps:** update dependency [@typescript-eslint](https://github.com/typescript-eslint)/eslint-plugin to v6.9.0 ([#753](https://github.com/kelektiv/node-cron/issues/753)) ([9cec04f](https://github.com/kelektiv/node-cron/commit/9cec04f1578f26f50d3e338ad3a9053ef74bbb01))
|
|
23
|
+
|
|
1
24
|
## [3.1.5](https://github.com/kelektiv/node-cron/compare/v3.1.4...v3.1.5) (2023-10-26)
|
|
2
25
|
|
|
3
26
|
|
package/dist/job.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ export declare class CronJob<OC extends CronOnCompleteCommand | null = null, C =
|
|
|
5
5
|
running: boolean;
|
|
6
6
|
unrefTimeout: boolean;
|
|
7
7
|
lastExecution: Date | null;
|
|
8
|
+
runOnce: boolean;
|
|
8
9
|
context: CronContext<C>;
|
|
9
10
|
onComplete?: WithOnComplete<OC> extends true ? CronOnCompleteCallback : undefined;
|
|
10
|
-
get runOnce(): boolean;
|
|
11
11
|
private _timeout?;
|
|
12
12
|
private _callbacks;
|
|
13
13
|
constructor(cronTime: CronJobParams<OC, C>['cronTime'], onTick: CronJobParams<OC, C>['onTick'], onComplete?: CronJobParams<OC, C>['onComplete'], start?: CronJobParams<OC, C>['start'], timeZone?: CronJobParams<OC, C>['timeZone'], context?: CronJobParams<OC, C>['context'], runOnInit?: CronJobParams<OC, C>['runOnInit'], utcOffset?: null, unrefTimeout?: CronJobParams<OC, C>['unrefTimeout']);
|
package/dist/job.js
CHANGED
|
@@ -5,13 +5,11 @@ const child_process_1 = require("child_process");
|
|
|
5
5
|
const errors_1 = require("./errors");
|
|
6
6
|
const time_1 = require("./time");
|
|
7
7
|
class CronJob {
|
|
8
|
-
get runOnce() {
|
|
9
|
-
return this.cronTime.realDate;
|
|
10
|
-
}
|
|
11
8
|
constructor(cronTime, onTick, onComplete, start, timeZone, context, runOnInit, utcOffset, unrefTimeout) {
|
|
12
9
|
this.running = false;
|
|
13
10
|
this.unrefTimeout = false;
|
|
14
11
|
this.lastExecution = null;
|
|
12
|
+
this.runOnce = false;
|
|
15
13
|
this._callbacks = [];
|
|
16
14
|
this.context = (context !== null && context !== void 0 ? context : this);
|
|
17
15
|
if (timeZone != null && utcOffset != null) {
|
|
@@ -32,6 +30,9 @@ class CronJob {
|
|
|
32
30
|
if (onComplete != null) {
|
|
33
31
|
this.onComplete = this._fnWrap(onComplete);
|
|
34
32
|
}
|
|
33
|
+
if (this.cronTime.realDate) {
|
|
34
|
+
this.runOnce = true;
|
|
35
|
+
}
|
|
35
36
|
this.addCallback(this._fnWrap(onTick));
|
|
36
37
|
if (runOnInit) {
|
|
37
38
|
this.lastExecution = new Date();
|
|
@@ -81,6 +82,8 @@ class CronJob {
|
|
|
81
82
|
const wasRunning = this.running;
|
|
82
83
|
this.stop();
|
|
83
84
|
this.cronTime = time;
|
|
85
|
+
if (time.realDate)
|
|
86
|
+
this.runOnce = true;
|
|
84
87
|
if (wasRunning)
|
|
85
88
|
this.start();
|
|
86
89
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cron",
|
|
3
3
|
"description": "Cron jobs for your node",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.6",
|
|
5
5
|
"author": "Nick Campbell <nicholas.j.campbell@gmail.com> (https://github.com/ncb000gt)",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/kelektiv/node-cron/issues"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"luxon": "~3.4.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@commitlint/cli": "18.
|
|
31
|
+
"@commitlint/cli": "18.2.0",
|
|
32
32
|
"@fast-check/jest": "1.7.3",
|
|
33
33
|
"@insurgentlab/commitlint-config": "18.1.3",
|
|
34
34
|
"@insurgentlab/conventional-changelog-preset": "7.0.0",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"@semantic-release/npm": "11.0.0",
|
|
40
40
|
"@semantic-release/release-notes-generator": "12.0.0",
|
|
41
41
|
"@types/jest": "29.5.6",
|
|
42
|
-
"@types/node": "20.8.
|
|
42
|
+
"@types/node": "20.8.9",
|
|
43
43
|
"@types/sinon": "10.0.20",
|
|
44
|
-
"@typescript-eslint/eslint-plugin": "6.
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "6.9.0",
|
|
45
45
|
"chai": "4.3.10",
|
|
46
46
|
"eslint": "8.52.0",
|
|
47
47
|
"eslint-config-prettier": "9.0.0",
|