@kingsworld/plugin-cron 3.0.5-next.d7afac1 → 3.0.5
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 +6 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/lib/structures/CronTaskStore.cjs +2 -2
- package/dist/cjs/lib/structures/CronTaskStore.cjs.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/lib/structures/CronTaskStore.mjs +2 -2
- package/dist/esm/lib/structures/CronTaskStore.mjs.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
# [@kingsworld/plugin-cron@3.0.5](https://github.com/Kings-World/sapphire-plugins/compare/@kingsworld/plugin-cron@3.0.4...@kingsworld/plugin-cron@3.0.5) - (2025-05-21)
|
6
|
+
|
7
|
+
## 🐛 Bug Fixes
|
8
|
+
|
9
|
+
- Correct the usage of the normalizePattern() function ([2db627a](https://github.com/Kings-World/sapphire-plugins/commit/2db627a85d91f185820f0796df360b4ade3c77c5)) ([#112](https://github.com/Kings-World/sapphire-plugins/pull/112) by @SerenModz21)
|
10
|
+
|
5
11
|
# [@kingsworld/plugin-cron@3.0.4](https://github.com/Kings-World/sapphire-plugins/compare/@kingsworld/plugin-cron@3.0.3...@kingsworld/plugin-cron@3.0.4) - (2025-04-20)
|
6
12
|
|
7
13
|
## 📝 Documentation
|
package/dist/cjs/index.cjs
CHANGED
@@ -6,7 +6,7 @@ var CronTaskStore_cjs = require('./lib/structures/CronTaskStore.cjs');
|
|
6
6
|
var CronTaskTypes_cjs = require('./lib/types/CronTaskTypes.cjs');
|
7
7
|
|
8
8
|
// src/index.ts
|
9
|
-
var version = "3.0.5
|
9
|
+
var version = "3.0.5";
|
10
10
|
|
11
11
|
exports.version = version;
|
12
12
|
Object.keys(CronTaskHandler_cjs).forEach(function (k) {
|
package/dist/cjs/index.cjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;AA+BO,IAAM,OAAkB,GAAA","file":"index.cjs","sourcesContent":["import type { CronTaskStore } from './lib/structures/CronTaskStore';\nimport type { CronTaskHandler } from './lib/CronTaskHandler';\nimport type { CronTaskHandlerOptions } from './lib/types/CronTaskTypes';\n\nexport * from './lib/CronTaskHandler';\nexport * from './lib/structures/CronTask';\nexport * from './lib/structures/CronTaskStore';\nexport * from './lib/types/CronTaskTypes';\n\ndeclare module '@sapphire/pieces' {\n\tinterface Container {\n\t\tcronTasks: CronTaskHandler;\n\t}\n\n\tinterface StoreRegistryEntries {\n\t\t'cron-tasks': CronTaskStore;\n\t}\n}\n\ndeclare module 'discord.js' {\n\texport interface ClientOptions {\n\t\tcronTasks?: Partial<CronTaskHandlerOptions>;\n\t}\n}\n\n/**\n * The [@kingsworld/plugin-cron](https://github.com/Kings-World/sapphire-plugins/tree/main/packages/cron) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\nexport const version: string = '3.0.5
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;AA+BO,IAAM,OAAkB,GAAA","file":"index.cjs","sourcesContent":["import type { CronTaskStore } from './lib/structures/CronTaskStore';\nimport type { CronTaskHandler } from './lib/CronTaskHandler';\nimport type { CronTaskHandlerOptions } from './lib/types/CronTaskTypes';\n\nexport * from './lib/CronTaskHandler';\nexport * from './lib/structures/CronTask';\nexport * from './lib/structures/CronTaskStore';\nexport * from './lib/types/CronTaskTypes';\n\ndeclare module '@sapphire/pieces' {\n\tinterface Container {\n\t\tcronTasks: CronTaskHandler;\n\t}\n\n\tinterface StoreRegistryEntries {\n\t\t'cron-tasks': CronTaskStore;\n\t}\n}\n\ndeclare module 'discord.js' {\n\texport interface ClientOptions {\n\t\tcronTasks?: Partial<CronTaskHandlerOptions>;\n\t}\n}\n\n/**\n * The [@kingsworld/plugin-cron](https://github.com/Kings-World/sapphire-plugins/tree/main/packages/cron) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\nexport const version: string = '3.0.5';\n"]}
|
@@ -99,8 +99,8 @@ var _CronTaskStore = class _CronTaskStore extends pieces.Store {
|
|
99
99
|
() => {
|
100
100
|
if (sentry && typeof pattern === "string" && !pattern.includes(":")) {
|
101
101
|
return sentry.withMonitor(key, () => void value.run.bind(value)(), {
|
102
|
-
schedule: { type: "crontab", value: pattern },
|
103
|
-
timezone: timeZone
|
102
|
+
schedule: { type: "crontab", value: normalizePattern_cjs.normalizePattern(pattern) },
|
103
|
+
timezone: timeZone
|
104
104
|
});
|
105
105
|
}
|
106
106
|
return value.run.bind(value)();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/structures/CronTaskStore.ts"],"names":["Store","CronTask","Cron","normalizePattern"],"mappings":";;;;;;;;;AAKO,IAAM,cAAA,GAAN,MAAM,cAAA,SAAsBA,YAA8B,CAAA;AAAA,EACzD,WAAc,GAAA;AACpB,IAAA,KAAA,CAAMC,qBAAU,EAAA,EAAE,IAAM,EAAA,YAAA,EAAc,CAAA;AAAA;AACvC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaO,QAAW,GAAA;AACjB,IAAW,KAAA,MAAA,IAAA,IAAQ,IAAK,CAAA,MAAA,EAAU,EAAA;AACjC,MAAA,IAAI,CAAC,IAAK,CAAA,OAAA,IAAW,CAAC,IAAK,CAAA,GAAA,CAAI,WAAa,EAAA;AAC5C,MAAA,IAAA,CAAK,IAAI,KAAM,EAAA;AAAA;AAGhB,IAAAD,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;AACzB,IAAA,IAAI,IAAQ,IAAA,CAAC,IAAK,CAAA,GAAA,CAAI,WAAa,EAAA;AAClC,MAAA,IAAA,CAAK,IAAI,IAAK,EAAA;AAAA;AAGf,IAAO,OAAA,KAAA,CAAM,OAAO,GAAG,CAAA;AAAA;AACxB;AAAA;AAAA;AAAA,EAKgB,KAAQ,GAAA;AACvB,IAAA,IAAA,CAAK,OAAQ,EAAA;AACb,IAAA,OAAO,MAAM,KAAM,EAAA;AAAA;AAErB,CAAA;AA3IiE,MAAA,CAAA,cAAA,EAAA,eAAA,CAAA;AAA1D,IAAM,aAAN,GAAA","file":"CronTaskStore.cjs","sourcesContent":["import { Store } from '@sapphire/pieces';\nimport { Cron } from 'croner';\nimport { CronTask } from './CronTask';\nimport { normalizePattern } from '../utils/normalizePattern';\n\nexport class CronTaskStore extends Store<CronTask, 'cron-tasks'> {\n\tpublic constructor() {\n\t\tsuper(CronTask, { name: 'cron-tasks' });\n\t}\n\n\t/**\n\t * Loops over all tasks and pauses those that are running.\n\t *\n\t * @remarks\n\t * This method will only pause tasks that:\n\t * - Are enabled\n\t * - Are currently running\n\t * - Have not been permanently stopped\n\t *\n\t * @returns CronTaskStore\n\t */\n\tpublic pauseAll() {\n\t\tfor (const task of this.values()) {\n\t\t\tif (!task.enabled || !task.job.isRunning()) continue;\n\t\t\ttask.job.pause();\n\t\t}\n\n\t\tStore.logger?.(`[STORE => ${this.name}] [PAUSE] Paused all cronjob tasks.`);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Loops over all tasks and resumes those that are paused.\n\t *\n\t * @remarks\n\t * This method will only resume tasks that:\n\t * - Are enabled\n\t * - Are not currently running\n\t * - Have not been permanently stopped\n\t *\n\t * @returns CronTaskStore\n\t */\n\tpublic resumeAll() {\n\t\tfor (const task of this.values()) {\n\t\t\tif (!task.enabled || task.job.isRunning() || task.job.isStopped()) continue;\n\t\t\ttask.job.resume();\n\t\t}\n\n\t\tStore.logger?.(`[STORE => ${this.name}] [RESUME] Resumed all cronjob tasks.`);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Loops over all tasks and stops those that are running.\n\t *\n\t * @remarks\n\t * This method will only stop tasks that:\n\t * - Are enabled\n\t * - Have not been permanently stopped\n\t *\n\t * ⚠️ Stopping jobs is **permanent** and cannot be resumed afterwards!\n\t *\n\t * @returns CronTaskStore\n\t */\n\tpublic stopAll() {\n\t\tfor (const task of this.values()) {\n\t\t\tif (!task.enabled || task.job.isStopped()) continue;\n\t\t\ttask.job.stop();\n\t\t}\n\n\t\tStore.logger?.(`[STORE => ${this.name}] [STOP] Stopped all cronjob tasks.`);\n\t\treturn this;\n\t}\n\n\tpublic override set(key: string, value: CronTask): this {\n\t\tconst { pattern, timezone, protect, ...options } = value.options;\n\t\tconst { sentry, defaultTimezone } = this.container.cronTasks;\n\n\t\t// if a task with the same key already exists, stop it before creating a new one\n\t\tif (this.has(key)) {\n\t\t\tStore.logger?.(`[STORE => ${this.name}] [SET] Stopping existing cronjob task before creating a new one.`);\n\t\t\tthis.get(key)?.job.stop();\n\t\t}\n\n\t\tconst timeZone = timezone ?? defaultTimezone;\n\n\t\ttry {\n\t\t\tStore.logger?.(\n\t\t\t\t`[STORE => ${this.name}] [SET] Creating cronjob for ${key} with '${pattern}' as the pattern and '${timeZone}' for the timezone`\n\t\t\t);\n\n\t\t\tvalue.job = new Cron(\n\t\t\t\tpattern,\n\t\t\t\t{\n\t\t\t\t\tname: key,\n\t\t\t\t\ttimezone: timeZone,\n\t\t\t\t\tpaused: true, // we start the job manually once the client is ready\n\t\t\t\t\tprotect: value.protect ? (job) => void value.protect!(job) : protect,\n\t\t\t\t\tcatch: (error) => {\n\t\t\t\t\t\tvalue.error('Encountered an error while running the cron job', error);\n\t\t\t\t\t\tif (sentry) sentry.captureException(error);\n\t\t\t\t\t\tvoid value.catch?.(error, value.job);\n\t\t\t\t\t},\n\t\t\t\t\t...options\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\t// we only want to monitor cron patterns and not single-use tasks that croner supports\n\t\t\t\t\tif (sentry && typeof pattern === 'string' && !pattern.includes(':')) {\n\t\t\t\t\t\treturn sentry.withMonitor(key, () => void value.run.bind(value)(), {\n\t\t\t\t\t\t\tschedule: { type: 'crontab', value: normalizePattern(pattern) },\n\t\t\t\t\t\t\ttimezone: timeZone\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\treturn value.run.bind(value)();\n\t\t\t\t}\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tvalue.error('Encountered an error while creating the cron job', error);\n\t\t\tvoid value.unload();\n\t\t}\n\n\t\treturn super.set(key, value);\n\t}\n\n\t/**\n\t * Deletes a task from the store and stops it if it's running.\n\t */\n\tpublic override delete(key: string) {\n\t\tconst task = this.get(key);\n\t\tif (task && !task.job.isStopped()) {\n\t\t\ttask.job.stop();\n\t\t}\n\n\t\treturn super.delete(key);\n\t}\n\n\t/**\n\t * Stops all running cron jobs and clears the store.\n\t */\n\tpublic override clear() {\n\t\tthis.stopAll();\n\t\treturn super.clear();\n\t}\n}\n"]}
|
package/dist/esm/index.mjs
CHANGED
@@ -4,7 +4,7 @@ export * from './lib/structures/CronTask.mjs';
|
|
4
4
|
export * from './lib/structures/CronTaskStore.mjs';
|
5
5
|
export * from './lib/types/CronTaskTypes.mjs';
|
6
6
|
|
7
|
-
var version = "3.0.5
|
7
|
+
var version = "3.0.5";
|
8
8
|
|
9
9
|
export { version };
|
10
10
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AA+BO,IAAM,OAAkB,GAAA","file":"index.mjs","sourcesContent":["import type { CronTaskStore } from './lib/structures/CronTaskStore';\nimport type { CronTaskHandler } from './lib/CronTaskHandler';\nimport type { CronTaskHandlerOptions } from './lib/types/CronTaskTypes';\n\nexport * from './lib/CronTaskHandler';\nexport * from './lib/structures/CronTask';\nexport * from './lib/structures/CronTaskStore';\nexport * from './lib/types/CronTaskTypes';\n\ndeclare module '@sapphire/pieces' {\n\tinterface Container {\n\t\tcronTasks: CronTaskHandler;\n\t}\n\n\tinterface StoreRegistryEntries {\n\t\t'cron-tasks': CronTaskStore;\n\t}\n}\n\ndeclare module 'discord.js' {\n\texport interface ClientOptions {\n\t\tcronTasks?: Partial<CronTaskHandlerOptions>;\n\t}\n}\n\n/**\n * The [@kingsworld/plugin-cron](https://github.com/Kings-World/sapphire-plugins/tree/main/packages/cron) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\nexport const version: string = '3.0.5
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;AA+BO,IAAM,OAAkB,GAAA","file":"index.mjs","sourcesContent":["import type { CronTaskStore } from './lib/structures/CronTaskStore';\nimport type { CronTaskHandler } from './lib/CronTaskHandler';\nimport type { CronTaskHandlerOptions } from './lib/types/CronTaskTypes';\n\nexport * from './lib/CronTaskHandler';\nexport * from './lib/structures/CronTask';\nexport * from './lib/structures/CronTaskStore';\nexport * from './lib/types/CronTaskTypes';\n\ndeclare module '@sapphire/pieces' {\n\tinterface Container {\n\t\tcronTasks: CronTaskHandler;\n\t}\n\n\tinterface StoreRegistryEntries {\n\t\t'cron-tasks': CronTaskStore;\n\t}\n}\n\ndeclare module 'discord.js' {\n\texport interface ClientOptions {\n\t\tcronTasks?: Partial<CronTaskHandlerOptions>;\n\t}\n}\n\n/**\n * The [@kingsworld/plugin-cron](https://github.com/Kings-World/sapphire-plugins/tree/main/packages/cron) version that you are currently using.\n * An example use of this is showing it of in a bot information command.\n *\n * Note to Sapphire developers: This needs to explicitly be `string` so it is not typed as the string that gets replaced by esbuild\n */\nexport const version: string = '3.0.5';\n"]}
|
@@ -96,8 +96,8 @@ var _CronTaskStore = class _CronTaskStore extends Store {
|
|
96
96
|
() => {
|
97
97
|
if (sentry && typeof pattern === "string" && !pattern.includes(":")) {
|
98
98
|
return sentry.withMonitor(key, () => void value.run.bind(value)(), {
|
99
|
-
schedule: { type: "crontab", value: pattern },
|
100
|
-
timezone: timeZone
|
99
|
+
schedule: { type: "crontab", value: normalizePattern(pattern) },
|
100
|
+
timezone: timeZone
|
101
101
|
});
|
102
102
|
}
|
103
103
|
return value.run.bind(value)();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/structures/CronTaskStore.ts"],"names":[],"mappings":";;;;;;AAKO,IAAM,cAAA,GAAN,MAAM,cAAA,SAAsB,KAA8B,CAAA;AAAA,EACzD,WAAc,GAAA;AACpB,IAAA,KAAA,CAAM,QAAU,EAAA,EAAE,IAAM,EAAA,YAAA,EAAc,CAAA;AAAA;AACvC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaO,QAAW,GAAA;AACjB,IAAW,KAAA,MAAA,IAAA,IAAQ,IAAK,CAAA,MAAA,EAAU,EAAA;AACjC,MAAA,IAAI,CAAC,IAAK,CAAA,OAAA,IAAW,CAAC,IAAK,CAAA,GAAA,CAAI,WAAa,EAAA;AAC5C,MAAA,IAAA,CAAK,IAAI,KAAM,EAAA;AAAA;AAGhB,IAAA,KAAA,CAAM,MAAS,GAAA,CAAA,UAAA,EAAa,IAAK,CAAA,IAAI,CAAqC,mCAAA,CAAA,CAAA;AAC1E,IAAO,OAAA,IAAA;AAAA;AACR;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaO,SAAY,GAAA;AAClB,IAAW,KAAA,MAAA,IAAA,IAAQ,IAAK,CAAA,MAAA,EAAU,EAAA;AACjC,MAAI,IAAA,CAAC,IAAK,CAAA,OAAA,IAAW,IAAK,CAAA,GAAA,CAAI,WAAe,IAAA,IAAA,CAAK,GAAI,CAAA,SAAA,EAAa,EAAA;AACnE,MAAA,IAAA,CAAK,IAAI,MA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,IAAA,MAAA,IAAU,OAAO,OAAY,KAAA,QAAA,IAAY,CAAC,OAAQ,CAAA,QAAA,CAAS,GAAG,CAAG,EAAA;AACpE,YAAO,OAAA,MAAA,CAAO,WAAY,CAAA,GAAA,EAAK,MAAM,KAAK,MAAM,GAAI,CAAA,IAAA,CAAK,KAAK,CAAA,EAAK,EAAA;AAAA,cAClE,UAAU,EAAE,IAAA,EAAM,WAAW,KAAO,EAAA,gBAAA,CAAiB,OAAO,CAAE,EAAA;AAAA,cAC9D,QAAU,EAAA;AAAA,aACV,CAAA;AAAA;AAGF,UAAA,OAAO,KAAM,CAAA,GAAA,CAAI,IAAK,CAAA,KAAK,CAAE,EAAA;AAAA;AAC9B,OACD;AAAA,aACQ,KAAO,EAAA;AACf,MAAM,KAAA,CAAA,KAAA,CAAM,oDAAoD,KAAK,CAAA;AACrE,MAAA,KAAK,MAAM,MAAO,EAAA;AAAA;AAGnB,IAAO,OAAA,KAAA,CAAM,GAAI,CAAA,GAAA,EAAK,KAAK,CAAA;AAAA;AAC5B;AAAA;AAAA;AAAA,EAKgB,OAAO,GAAa,EAAA;AACnC,IAAM,MAAA,IAAA,GAAO,IAAK,CAAA,GAAA,CAAI,GAAG,CAAA;AACzB,IAAA,IAAI,IAAQ,IAAA,CAAC,IAAK,CAAA,GAAA,CAAI,WAAa,EAAA;AAClC,MAAA,IAAA,CAAK,IAAI,IAAK,EAAA;AAAA;AAGf,IAAO,OAAA,KAAA,CAAM,OAAO,GAAG,CAAA;AAAA;AACxB;AAAA;AAAA;AAAA,EAKgB,KAAQ,GAAA;AACvB,IAAA,IAAA,CAAK,OAAQ,EAAA;AACb,IAAA,OAAO,MAAM,KAAM,EAAA;AAAA;AAErB,CAAA;AA3IiE,MAAA,CAAA,cAAA,EAAA,eAAA,CAAA;AAA1D,IAAM,aAAN,GAAA","file":"CronTaskStore.mjs","sourcesContent":["import { Store } from '@sapphire/pieces';\nimport { Cron } from 'croner';\nimport { CronTask } from './CronTask';\nimport { normalizePattern } from '../utils/normalizePattern';\n\nexport class CronTaskStore extends Store<CronTask, 'cron-tasks'> {\n\tpublic constructor() {\n\t\tsuper(CronTask, { name: 'cron-tasks' });\n\t}\n\n\t/**\n\t * Loops over all tasks and pauses those that are running.\n\t *\n\t * @remarks\n\t * This method will only pause tasks that:\n\t * - Are enabled\n\t * - Are currently running\n\t * - Have not been permanently stopped\n\t *\n\t * @returns CronTaskStore\n\t */\n\tpublic pauseAll() {\n\t\tfor (const task of this.values()) {\n\t\t\tif (!task.enabled || !task.job.isRunning()) continue;\n\t\t\ttask.job.pause();\n\t\t}\n\n\t\tStore.logger?.(`[STORE => ${this.name}] [PAUSE] Paused all cronjob tasks.`);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Loops over all tasks and resumes those that are paused.\n\t *\n\t * @remarks\n\t * This method will only resume tasks that:\n\t * - Are enabled\n\t * - Are not currently running\n\t * - Have not been permanently stopped\n\t *\n\t * @returns CronTaskStore\n\t */\n\tpublic resumeAll() {\n\t\tfor (const task of this.values()) {\n\t\t\tif (!task.enabled || task.job.isRunning() || task.job.isStopped()) continue;\n\t\t\ttask.job.resume();\n\t\t}\n\n\t\tStore.logger?.(`[STORE => ${this.name}] [RESUME] Resumed all cronjob tasks.`);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Loops over all tasks and stops those that are running.\n\t *\n\t * @remarks\n\t * This method will only stop tasks that:\n\t * - Are enabled\n\t * - Have not been permanently stopped\n\t *\n\t * ⚠️ Stopping jobs is **permanent** and cannot be resumed afterwards!\n\t *\n\t * @returns CronTaskStore\n\t */\n\tpublic stopAll() {\n\t\tfor (const task of this.values()) {\n\t\t\tif (!task.enabled || task.job.isStopped()) continue;\n\t\t\ttask.job.stop();\n\t\t}\n\n\t\tStore.logger?.(`[STORE => ${this.name}] [STOP] Stopped all cronjob tasks.`);\n\t\treturn this;\n\t}\n\n\tpublic override set(key: string, value: CronTask): this {\n\t\tconst { pattern, timezone, protect, ...options } = value.options;\n\t\tconst { sentry, defaultTimezone } = this.container.cronTasks;\n\n\t\t// if a task with the same key already exists, stop it before creating a new one\n\t\tif (this.has(key)) {\n\t\t\tStore.logger?.(`[STORE => ${this.name}] [SET] Stopping existing cronjob task before creating a new one.`);\n\t\t\tthis.get(key)?.job.stop();\n\t\t}\n\n\t\tconst timeZone = timezone ?? defaultTimezone;\n\n\t\ttry {\n\t\t\tStore.logger?.(\n\t\t\t\t`[STORE => ${this.name}] [SET] Creating cronjob for ${key} with '${pattern}' as the pattern and '${timeZone}' for the timezone`\n\t\t\t);\n\n\t\t\tvalue.job = new Cron(\n\t\t\t\tpattern,\n\t\t\t\t{\n\t\t\t\t\tname: key,\n\t\t\t\t\ttimezone: timeZone,\n\t\t\t\t\tpaused: true, // we start the job manually once the client is ready\n\t\t\t\t\tprotect: value.protect ? (job) => void value.protect!(job) : protect,\n\t\t\t\t\tcatch: (error) => {\n\t\t\t\t\t\tvalue.error('Encountered an error while running the cron job', error);\n\t\t\t\t\t\tif (sentry) sentry.captureException(error);\n\t\t\t\t\t\tvoid value.catch?.(error, value.job);\n\t\t\t\t\t},\n\t\t\t\t\t...options\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\t// we only want to monitor cron patterns and not single-use tasks that croner supports\n\t\t\t\t\tif (sentry && typeof pattern === 'string' && !pattern.includes(':')) {\n\t\t\t\t\t\treturn sentry.withMonitor(key, () => void value.run.bind(value)(), {\n\t\t\t\t\t\t\tschedule: { type: 'crontab', value: normalizePattern(pattern) },\n\t\t\t\t\t\t\ttimezone: timeZone\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\treturn value.run.bind(value)();\n\t\t\t\t}\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tvalue.error('Encountered an error while creating the cron job', error);\n\t\t\tvoid value.unload();\n\t\t}\n\n\t\treturn super.set(key, value);\n\t}\n\n\t/**\n\t * Deletes a task from the store and stops it if it's running.\n\t */\n\tpublic override delete(key: string) {\n\t\tconst task = this.get(key);\n\t\tif (task && !task.job.isStopped()) {\n\t\t\ttask.job.stop();\n\t\t}\n\n\t\treturn super.delete(key);\n\t}\n\n\t/**\n\t * Stops all running cron jobs and clears the store.\n\t */\n\tpublic override clear() {\n\t\tthis.stopAll();\n\t\treturn super.clear();\n\t}\n}\n"]}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@kingsworld/plugin-cron",
|
3
3
|
"description": "A simple @sapphire/framework plugin that aims to make use of the croner package and allow users to make cron jobs within their Sapphire discord bot.",
|
4
|
-
"version": "3.0.5
|
4
|
+
"version": "3.0.5",
|
5
5
|
"author": "Seren_Modz 21 <seren@kings-world.net>",
|
6
6
|
"license": "MIT",
|
7
7
|
"main": "dist/cjs/index.cjs",
|
@@ -51,10 +51,10 @@
|
|
51
51
|
"devDependencies": {
|
52
52
|
"@favware/cliff-jumper": "^6.0.0",
|
53
53
|
"@favware/rollup-type-bundler": "^4.0.0",
|
54
|
-
"@sentry/node": "^9.
|
55
|
-
"@types/node": "^22.15.
|
54
|
+
"@sentry/node": "^9.19.0",
|
55
|
+
"@types/node": "^22.15.18",
|
56
56
|
"concurrently": "^9.1.2",
|
57
|
-
"tsup": "^8.
|
57
|
+
"tsup": "^8.5.0",
|
58
58
|
"tsx": "^4.19.4",
|
59
59
|
"typescript": "~5.4.5"
|
60
60
|
},
|