@tachybase/module-cron 1.6.10 → 1.6.12

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.
@@ -1,9 +1,9 @@
1
1
  module.exports = {
2
- "@tachybase/client": "1.6.10",
3
- "@tego/server": "1.6.9",
2
+ "@tachybase/client": "1.6.12",
3
+ "@tego/server": "1.6.10",
4
4
  "react": "18.3.1",
5
5
  "antd": "5.22.5",
6
6
  "dayjs": "1.11.13",
7
- "@tachybase/schema": "1.6.9",
8
- "@tachybase/module-workflow": "1.6.10"
7
+ "@tachybase/schema": "1.6.10",
8
+ "@tachybase/module-workflow": "1.6.12"
9
9
  };
@@ -1 +1 @@
1
- {"name":"cron-parser","version":"4.9.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"types/index.d.ts","typesVersions":{"<4.1":{"*":["types/ts3/*"]}},"directories":{"test":"test"},"scripts":{"test:tsd":"tsd","test:unit":"TZ=UTC tap ./test/*.js","test:cover":"TZ=UTC tap --coverage-report=html ./test/*.js","lint":"eslint .","lint:fix":"eslint --fix .","test":"npm run lint && npm run test:unit && npm run test:tsd"},"repository":{"type":"git","url":"https://github.com/harrisiirak/cron-parser.git"},"keywords":["cron","crontab","parser"],"author":"Harri Siirak","contributors":["Nicholas Clawson","Daniel Prentis <daniel@salsitasoft.com>","Renault John Lecoultre","Richard Astbury <richard.astbury@gmail.com>","Meaglin Wasabi <Meaglin.wasabi@gmail.com>","Mike Kusold <hello@mikekusold.com>","Alex Kit <alex.kit@atmajs.com>","Santiago Gimeno <santiago.gimeno@gmail.com>","Daniel <darc.tec@gmail.com>","Christian Steininger <christian.steininger.cs@gmail.com>","Mykola Piskovyi <m.piskovyi@gmail.com>","Brian Vaughn <brian.david.vaughn@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Yasuhiroki <yasuhiroki.duck@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Brendan Warkentin <faazshift@gmail.com>","Charlie Fish <fishcharlie.code@gmail.com>","Ian Graves <ian+diskimage@iangrav.es>","Andy Thompson <me@andytson.com>","Regev Brody <regevbr@gmail.com>"],"license":"MIT","dependencies":{"luxon":"^3.2.1"},"devDependencies":{"eslint":"^8.27.0","sinon":"^15.0.1","tap":"^16.3.3","tsd":"^0.26.0"},"engines":{"node":">=12.0.0"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"files":["lib","types","LICENSE","README.md"],"_lastModified":"2026-03-18T11:19:57.877Z"}
1
+ {"name":"cron-parser","version":"4.9.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"types/index.d.ts","typesVersions":{"<4.1":{"*":["types/ts3/*"]}},"directories":{"test":"test"},"scripts":{"test:tsd":"tsd","test:unit":"TZ=UTC tap ./test/*.js","test:cover":"TZ=UTC tap --coverage-report=html ./test/*.js","lint":"eslint .","lint:fix":"eslint --fix .","test":"npm run lint && npm run test:unit && npm run test:tsd"},"repository":{"type":"git","url":"https://github.com/harrisiirak/cron-parser.git"},"keywords":["cron","crontab","parser"],"author":"Harri Siirak","contributors":["Nicholas Clawson","Daniel Prentis <daniel@salsitasoft.com>","Renault John Lecoultre","Richard Astbury <richard.astbury@gmail.com>","Meaglin Wasabi <Meaglin.wasabi@gmail.com>","Mike Kusold <hello@mikekusold.com>","Alex Kit <alex.kit@atmajs.com>","Santiago Gimeno <santiago.gimeno@gmail.com>","Daniel <darc.tec@gmail.com>","Christian Steininger <christian.steininger.cs@gmail.com>","Mykola Piskovyi <m.piskovyi@gmail.com>","Brian Vaughn <brian.david.vaughn@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Yasuhiroki <yasuhiroki.duck@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Brendan Warkentin <faazshift@gmail.com>","Charlie Fish <fishcharlie.code@gmail.com>","Ian Graves <ian+diskimage@iangrav.es>","Andy Thompson <me@andytson.com>","Regev Brody <regevbr@gmail.com>"],"license":"MIT","dependencies":{"luxon":"^3.2.1"},"devDependencies":{"eslint":"^8.27.0","sinon":"^15.0.1","tap":"^16.3.3","tsd":"^0.26.0"},"engines":{"node":">=12.0.0"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"files":["lib","types","LICENSE","README.md"],"_lastModified":"2026-03-23T11:42:33.028Z"}
@@ -114,20 +114,7 @@ class CronJobLock {
114
114
  nodeId: this.getNodeId(),
115
115
  acquiredAt: Date.now()
116
116
  };
117
- const cacheClient = this.cache;
118
- let acquired = false;
119
- if (typeof cacheClient.setIfNotExists === "function") {
120
- acquired = await cacheClient.setIfNotExists(lockKey, lockValue, lockTTL);
121
- } else if (typeof cacheClient.setNx === "function") {
122
- acquired = await cacheClient.setNx(lockKey, lockValue, lockTTL);
123
- } else {
124
- this.logger.warn(
125
- "CronJobLock cache implementation does not support atomic set-if-not-exists operations. Distributed locking for cron jobs is disabled. / \u5F53\u524D\u7F13\u5B58\u5B9E\u73B0\u4E0D\u652F\u6301\u539F\u5B50\u6027 set-if-not-exists \u64CD\u4F5C\uFF0C\u5B9A\u65F6\u4EFB\u52A1\u7684\u5206\u5E03\u5F0F\u9501\u5DF2\u88AB\u7981\u7528\u3002"
126
- );
127
- throw new Error(
128
- "CronJobLock cache implementation does not support atomic set-if-not-exists operations"
129
- );
130
- }
117
+ const acquired = await this.cache.setIfNotExists(lockKey, lockValue, lockTTL);
131
118
  if (!acquired) {
132
119
  this.logger.debug(`Lock already exists for cron job ${cronJobId} at ${scheduledTime}`);
133
120
  return false;
@@ -137,13 +124,10 @@ class CronJobLock {
137
124
  } catch (error) {
138
125
  if (error instanceof Error) {
139
126
  this.logger.error(`Failed to acquire lock for cron job ${cronJobId}: ${error.message}`);
140
- throw error;
127
+ return true;
141
128
  }
142
- this.logger.error(
143
- `Failed to acquire lock for cron job ${cronJobId} due to unknown error type`,
144
- { error }
145
- );
146
- throw new Error("Failed to acquire lock due to unknown error");
129
+ this.logger.error(`Failed to acquire lock for cron job ${cronJobId} due to unknown error type`, { error });
130
+ return true;
147
131
  }
148
132
  }
149
133
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tachybase/module-cron",
3
3
  "displayName": "Cron job",
4
- "version": "1.6.10",
4
+ "version": "1.6.12",
5
5
  "description": "Schedule tasks to run at specific times, using a workflow approach",
6
6
  "keywords": [
7
7
  "System management"
@@ -18,16 +18,16 @@
18
18
  "main": "dist/server/index.js",
19
19
  "dependencies": {},
20
20
  "devDependencies": {
21
- "@tachybase/schema": "1.6.9",
22
- "@tachybase/test": "1.6.9",
23
- "@tego/client": "1.6.9",
24
- "@tego/server": "1.6.9",
21
+ "@tachybase/schema": "1.6.10",
22
+ "@tachybase/test": "1.6.10",
23
+ "@tego/client": "1.6.10",
24
+ "@tego/server": "1.6.10",
25
25
  "antd": "5.22.5",
26
26
  "cron-parser": "4.9.0",
27
27
  "dayjs": "1.11.13",
28
28
  "react-js-cron": "^3.2.0",
29
- "@tachybase/client": "1.6.10",
30
- "@tachybase/module-workflow": "1.6.10"
29
+ "@tachybase/module-workflow": "1.6.12",
30
+ "@tachybase/client": "1.6.12"
31
31
  },
32
32
  "description.zh-CN": "安排任务在特定时间运行,采用工作流的方式",
33
33
  "displayName.zh-CN": "定时任务",