fix(core): update
This commit is contained in:
parent
edadbe6cf5
commit
4dd4980374
@ -119,6 +119,6 @@ jobs:
|
||||
run: |
|
||||
npmci node install stable
|
||||
npmci npm install
|
||||
pnpm install -g @gitzone/tsdoc
|
||||
pnpm install -g @git.zone/tsdoc
|
||||
npmci command tsdoc
|
||||
continue-on-error: true
|
||||
|
18
package.json
18
package.json
@ -13,19 +13,19 @@
|
||||
"buildDocs": "tsdoc"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.66",
|
||||
"@gitzone/tsbundle": "^2.0.8",
|
||||
"@gitzone/tsrun": "^1.2.44",
|
||||
"@gitzone/tstest": "^1.0.77",
|
||||
"@push.rocks/tapbundle": "^5.0.12",
|
||||
"@types/node": "^20.4.2"
|
||||
"@git.zone/tsbuild": "^2.1.66",
|
||||
"@git.zone/tsbundle": "^2.0.8",
|
||||
"@git.zone/tsrun": "^1.2.44",
|
||||
"@git.zone/tstest": "^1.0.77",
|
||||
"@push.rocks/tapbundle": "^5.0.15",
|
||||
"@types/node": "^20.8.7"
|
||||
},
|
||||
"dependencies": {
|
||||
"@push.rocks/lik": "^6.0.3",
|
||||
"@push.rocks/lik": "^6.0.5",
|
||||
"@push.rocks/smartdelay": "^3.0.5",
|
||||
"@push.rocks/smartpromise": "^4.0.3",
|
||||
"croner": "^5.3.4",
|
||||
"dayjs": "^1.11.9",
|
||||
"croner": "^7.0.3",
|
||||
"dayjs": "^1.11.10",
|
||||
"is-nan": "^1.3.2",
|
||||
"pretty-ms": "^8.0.0"
|
||||
},
|
||||
|
2511
pnpm-lock.yaml
generated
2511
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smarttime',
|
||||
version: '4.0.5',
|
||||
version: '4.0.6',
|
||||
description: 'handle time in smart ways'
|
||||
}
|
||||
|
@ -34,40 +34,41 @@ export class CronManager {
|
||||
for (const cronJob of this.cronjobs.getArray()) {
|
||||
cronJob.start();
|
||||
}
|
||||
const runCronCycle = async () => {
|
||||
this.executionTimeout = new plugins.smartdelay.Timeout(0);
|
||||
do {
|
||||
let nextRunningCronjob: CronJob;
|
||||
for (const cronJob of this.cronjobs.getArray()) {
|
||||
cronJob.checkExecution();
|
||||
if (
|
||||
!nextRunningCronjob ||
|
||||
cronJob.getTimeToNextExecution() < nextRunningCronjob.getTimeToNextExecution()
|
||||
) {
|
||||
nextRunningCronjob = cronJob;
|
||||
}
|
||||
}
|
||||
if (nextRunningCronjob) {
|
||||
this.executionTimeout = new plugins.smartdelay.Timeout(
|
||||
nextRunningCronjob.getTimeToNextExecution()
|
||||
);
|
||||
console.log(
|
||||
`Next CronJob scheduled in ${getMilliSecondsAsHumanReadableString(
|
||||
this.executionTimeout.getTimeLeft()
|
||||
)}`
|
||||
);
|
||||
} else {
|
||||
this.executionTimeout = new plugins.smartdelay.Timeout(1000);
|
||||
console.log('no cronjobs specified! Checking again in 1 second');
|
||||
}
|
||||
|
||||
await this.executionTimeout.promise;
|
||||
} while (this.status === 'started');
|
||||
};
|
||||
runCronCycle();
|
||||
this.runCronCycle();
|
||||
}
|
||||
}
|
||||
|
||||
private async runCronCycle() {
|
||||
this.executionTimeout = new plugins.smartdelay.Timeout(0);
|
||||
do {
|
||||
let nextRunningCronjob: CronJob;
|
||||
for (const cronJob of this.cronjobs.getArray()) {
|
||||
cronJob.checkExecution();
|
||||
if (
|
||||
!nextRunningCronjob ||
|
||||
cronJob.getTimeToNextExecution() < nextRunningCronjob.getTimeToNextExecution()
|
||||
) {
|
||||
nextRunningCronjob = cronJob;
|
||||
}
|
||||
}
|
||||
if (nextRunningCronjob) {
|
||||
this.executionTimeout = new plugins.smartdelay.Timeout(
|
||||
nextRunningCronjob.getTimeToNextExecution()
|
||||
);
|
||||
console.log(
|
||||
`Next CronJob scheduled in ${getMilliSecondsAsHumanReadableString(
|
||||
this.executionTimeout.getTimeLeft()
|
||||
)}`
|
||||
);
|
||||
} else {
|
||||
this.executionTimeout = new plugins.smartdelay.Timeout(1000);
|
||||
console.log('no cronjobs specified! Checking again in 1 second');
|
||||
}
|
||||
|
||||
await this.executionTimeout.promise;
|
||||
} while (this.status === 'started');
|
||||
};
|
||||
|
||||
/**
|
||||
* stops all cronjobs
|
||||
*/
|
||||
|
@ -36,7 +36,7 @@ export class Timer {
|
||||
/**
|
||||
* the current timeout the needs to be canceled when this Timer is stopped
|
||||
*/
|
||||
private currentTimeout: NodeJS.Timer;
|
||||
private currentTimeout: NodeJS.Timeout;
|
||||
|
||||
// a deferred triggeted when Timer has completed
|
||||
private completedDeferred = plugins.smartpromise.defer<void>();
|
||||
|
@ -3,9 +3,12 @@
|
||||
"experimentalDecorators": true,
|
||||
"useDefineForClassFields": false,
|
||||
"target": "ES2022",
|
||||
"module": "ES2022",
|
||||
"moduleResolution": "nodenext",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"esModuleInterop": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
}
|
||||
"verbatimModuleSyntax": true
|
||||
},
|
||||
"exclude": [
|
||||
"dist_*/**/*.d.ts"
|
||||
]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user