@enshou/cron 0.0.5 → 0.0.7
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/LICENSE +1 -1
- package/dist/index.mjs +4 -4
- package/package.json +7 -7
package/LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright 2026 Ivan Popov <
|
|
1
|
+
Copyright 2026 Ivan Popov <iivanpopov@proton.me>
|
|
2
2
|
|
|
3
3
|
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
|
4
4
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { token } from "@enshou/di";
|
|
2
2
|
//#region ../../shared/src/polyfill.ts
|
|
3
3
|
if (!Symbol.metadata) Symbol.metadata = Symbol.for("Symbol.metadata");
|
|
4
4
|
//#endregion
|
|
@@ -24,9 +24,9 @@ function Cron(pattern) {
|
|
|
24
24
|
function CronPlugin({ jobs }) {
|
|
25
25
|
return { onApplicationInit: async ({ options: { container } }) => {
|
|
26
26
|
for (const job of jobs) {
|
|
27
|
-
const
|
|
28
|
-
container.registerClass(
|
|
29
|
-
const instance = await container.resolveAsync(
|
|
27
|
+
const jobToken = token(job.name);
|
|
28
|
+
container.registerClass(jobToken, job);
|
|
29
|
+
const instance = await container.resolveAsync(jobToken);
|
|
30
30
|
const metadata = asCronMetadata(instance[Symbol.metadata]);
|
|
31
31
|
for (const [methodName, cronPattern] of metadata.jobs) {
|
|
32
32
|
const handler = instance[methodName].bind(instance);
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enshou/cron",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "ISC",
|
|
6
|
-
"author": "Ivan Popov <
|
|
6
|
+
"author": "Ivan Popov <iivanpopov@proton.me>",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/
|
|
9
|
+
"url": "https://github.com/iivanpopov/enshou.git"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"dist",
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"@types/bun": "^1.3.14",
|
|
25
25
|
"tsdown": "^0.22.3",
|
|
26
26
|
"typescript": "^6.0.2",
|
|
27
|
-
"@enshou/core": "0.12.
|
|
28
|
-
"@enshou/di": "0.8.
|
|
27
|
+
"@enshou/core": "0.12.9",
|
|
28
|
+
"@enshou/di": "0.8.9"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@enshou/
|
|
32
|
-
"@enshou/
|
|
31
|
+
"@enshou/core": "0.12.9",
|
|
32
|
+
"@enshou/di": "0.8.9"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "tsdown"
|