koatty_schedule 1.5.10 → 1.5.11
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/.rollup.config.js +62 -62
- package/CHANGELOG.md +25 -23
- package/LICENSE +29 -29
- package/README.md +47 -47
- package/dist/LICENSE +29 -29
- package/dist/README.md +47 -47
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -11
- package/dist/index.mjs +11 -11
- package/dist/package.json +89 -90
- package/package.json +89 -90
package/.rollup.config.js
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Description:
|
|
3
|
-
* @Usage:
|
|
4
|
-
* @Author: richen
|
|
5
|
-
* @Date: 2021-12-17 10:20:44
|
|
6
|
-
* @LastEditTime: 2021-12-18 11:58:46
|
|
7
|
-
*/
|
|
8
|
-
import json from "@rollup/plugin-json";
|
|
9
|
-
import typescript from 'rollup-plugin-typescript2';
|
|
10
|
-
// import babel from '@rollup/plugin-babel';
|
|
11
|
-
|
|
12
|
-
export default [
|
|
13
|
-
{
|
|
14
|
-
input: './src/index.ts',
|
|
15
|
-
output: [{
|
|
16
|
-
format: 'cjs',
|
|
17
|
-
file: './dist/index.js',
|
|
18
|
-
banner: require('./scripts/copyright')
|
|
19
|
-
}],
|
|
20
|
-
plugins: [
|
|
21
|
-
// babel({
|
|
22
|
-
// babelHelpers: "runtime",
|
|
23
|
-
// configFile: './babel.config.js',
|
|
24
|
-
// exclude: 'node_modules/**',
|
|
25
|
-
// }),
|
|
26
|
-
json(),
|
|
27
|
-
typescript({
|
|
28
|
-
tsconfigOverride: {
|
|
29
|
-
compilerOptions: {
|
|
30
|
-
declaration: false,
|
|
31
|
-
declarationMap: false,
|
|
32
|
-
module: "ESNext"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
]
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
input: './src/index.ts',
|
|
40
|
-
output: [{
|
|
41
|
-
format: 'es',
|
|
42
|
-
file: './dist/index.mjs',
|
|
43
|
-
banner: require('./scripts/copyright')
|
|
44
|
-
}],
|
|
45
|
-
plugins: [
|
|
46
|
-
// babel({
|
|
47
|
-
// babelHelpers: "runtime",
|
|
48
|
-
// configFile: './babel.config.js',
|
|
49
|
-
// exclude: 'node_modules/**',
|
|
50
|
-
// }),
|
|
51
|
-
json(),
|
|
52
|
-
typescript({
|
|
53
|
-
tsconfigOverride: {
|
|
54
|
-
compilerOptions: {
|
|
55
|
-
declaration: false,
|
|
56
|
-
declarationMap: false,
|
|
57
|
-
module: "ESNext"
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
})
|
|
61
|
-
]
|
|
62
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* @Description:
|
|
3
|
+
* @Usage:
|
|
4
|
+
* @Author: richen
|
|
5
|
+
* @Date: 2021-12-17 10:20:44
|
|
6
|
+
* @LastEditTime: 2021-12-18 11:58:46
|
|
7
|
+
*/
|
|
8
|
+
import json from "@rollup/plugin-json";
|
|
9
|
+
import typescript from 'rollup-plugin-typescript2';
|
|
10
|
+
// import babel from '@rollup/plugin-babel';
|
|
11
|
+
|
|
12
|
+
export default [
|
|
13
|
+
{
|
|
14
|
+
input: './src/index.ts',
|
|
15
|
+
output: [{
|
|
16
|
+
format: 'cjs',
|
|
17
|
+
file: './dist/index.js',
|
|
18
|
+
banner: require('./scripts/copyright')
|
|
19
|
+
}],
|
|
20
|
+
plugins: [
|
|
21
|
+
// babel({
|
|
22
|
+
// babelHelpers: "runtime",
|
|
23
|
+
// configFile: './babel.config.js',
|
|
24
|
+
// exclude: 'node_modules/**',
|
|
25
|
+
// }),
|
|
26
|
+
json(),
|
|
27
|
+
typescript({
|
|
28
|
+
tsconfigOverride: {
|
|
29
|
+
compilerOptions: {
|
|
30
|
+
declaration: false,
|
|
31
|
+
declarationMap: false,
|
|
32
|
+
module: "ESNext"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
input: './src/index.ts',
|
|
40
|
+
output: [{
|
|
41
|
+
format: 'es',
|
|
42
|
+
file: './dist/index.mjs',
|
|
43
|
+
banner: require('./scripts/copyright')
|
|
44
|
+
}],
|
|
45
|
+
plugins: [
|
|
46
|
+
// babel({
|
|
47
|
+
// babelHelpers: "runtime",
|
|
48
|
+
// configFile: './babel.config.js',
|
|
49
|
+
// exclude: 'node_modules/**',
|
|
50
|
+
// }),
|
|
51
|
+
json(),
|
|
52
|
+
typescript({
|
|
53
|
+
tsconfigOverride: {
|
|
54
|
+
compilerOptions: {
|
|
55
|
+
declaration: false,
|
|
56
|
+
declarationMap: false,
|
|
57
|
+
module: "ESNext"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
63
|
]
|
package/CHANGELOG.md
CHANGED
|
@@ -2,26 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
### [1.5.
|
|
6
|
-
|
|
7
|
-
### [1.5.
|
|
8
|
-
|
|
9
|
-
### [1.5.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
### [1.5.
|
|
20
|
-
|
|
21
|
-
### [1.5.
|
|
22
|
-
|
|
23
|
-
### [1.5.
|
|
24
|
-
|
|
25
|
-
### [1.
|
|
26
|
-
|
|
27
|
-
### [1.4.
|
|
5
|
+
### [1.5.11](https://github.com/thinkkoa/koatty_schedule/compare/v1.5.10...v1.5.11) (2023-07-28)
|
|
6
|
+
|
|
7
|
+
### [1.5.10](https://github.com/thinkkoa/koatty_schedule/compare/v1.5.8...v1.5.10) (2023-01-13)
|
|
8
|
+
|
|
9
|
+
### [1.5.8](https://github.com/thinkkoa/koatty_schedule/compare/v1.5.7...v1.5.8) (2022-11-03)
|
|
10
|
+
|
|
11
|
+
### [1.5.7](https://github.com/thinkkoa/koatty_schedule/compare/v1.5.6...v1.5.7) (2022-09-05)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* update ([8eb40be](https://github.com/thinkkoa/koatty_schedule/commit/8eb40be4f0778d218a2a8b9a9370ffbe26c9e884))
|
|
17
|
+
* upgrade deps ([51a68af](https://github.com/thinkkoa/koatty_schedule/commit/51a68af12437a08e3a5468b27b57ae597f66695d))
|
|
18
|
+
|
|
19
|
+
### [1.5.6](https://github.com/thinkkoa/koatty_schedule/compare/v1.5.5...v1.5.6) (2022-05-27)
|
|
20
|
+
|
|
21
|
+
### [1.5.5](https://github.com/thinkkoa/koatty_schedule/compare/v1.5.4...v1.5.5) (2022-03-02)
|
|
22
|
+
|
|
23
|
+
### [1.5.4](https://github.com/thinkkoa/koatty_schedule/compare/v1.5.2...v1.5.4) (2021-12-09)
|
|
24
|
+
|
|
25
|
+
### [1.5.2](https://github.com/thinkkoa/koatty_schedule/compare/v1.4.10...v1.5.2) (2021-12-02)
|
|
26
|
+
|
|
27
|
+
### [1.4.10](https://github.com/thinkkoa/koatty_schedule/compare/v1.4.8...v1.4.10) (2021-11-23)
|
|
28
|
+
|
|
29
|
+
### [1.4.8](https://github.com/thinkkoa/koatty_schedule/compare/v1.4.6...v1.4.8) (2021-11-20)
|
package/LICENSE
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
BSD 3-Clause License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020, Koatty
|
|
4
|
-
All rights reserved.
|
|
5
|
-
|
|
6
|
-
Redistribution and use in source and binary forms, with or without
|
|
7
|
-
modification, are permitted provided that the following conditions are met:
|
|
8
|
-
|
|
9
|
-
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
-
list of conditions and the following disclaimer.
|
|
11
|
-
|
|
12
|
-
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
-
this list of conditions and the following disclaimer in the documentation
|
|
14
|
-
and/or other materials provided with the distribution.
|
|
15
|
-
|
|
16
|
-
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
-
contributors may be used to endorse or promote products derived from
|
|
18
|
-
this software without specific prior written permission.
|
|
19
|
-
|
|
20
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020, Koatty
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
# koatty_schedule
|
|
2
|
-
Schedule for koatty.
|
|
3
|
-
|
|
4
|
-
Koatty框架的 Scheduled, SchedulerLock, Lock 支持库
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
# Usage
|
|
8
|
-
|
|
9
|
-
db.ts in koatty project:
|
|
10
|
-
|
|
11
|
-
```js
|
|
12
|
-
export default {
|
|
13
|
-
...
|
|
14
|
-
|
|
15
|
-
"CacheStore": {
|
|
16
|
-
type: "memory", // redis or memory, memory is default
|
|
17
|
-
// key_prefix: "koatty",
|
|
18
|
-
// host: '127.0.0.1',
|
|
19
|
-
// port: 6379,
|
|
20
|
-
// name: "",
|
|
21
|
-
// username: "",
|
|
22
|
-
// password: "",
|
|
23
|
-
// db: 0,
|
|
24
|
-
// timeout: 30,
|
|
25
|
-
// pool_size: 10,
|
|
26
|
-
// conn_timeout: 30
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
...
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
used in service:
|
|
35
|
-
|
|
36
|
-
```js
|
|
37
|
-
import { Scheduled, SchedulerLock } from "koatty_schedule";
|
|
38
|
-
|
|
39
|
-
export class TestService {
|
|
40
|
-
|
|
41
|
-
@Scheduled("0 * * * * *")
|
|
42
|
-
@SchedulerLock("testCron") //locker
|
|
43
|
-
Test(){
|
|
44
|
-
//todo
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
1
|
+
# koatty_schedule
|
|
2
|
+
Schedule for koatty.
|
|
3
|
+
|
|
4
|
+
Koatty框架的 Scheduled, SchedulerLock, Lock 支持库
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
# Usage
|
|
8
|
+
|
|
9
|
+
db.ts in koatty project:
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
export default {
|
|
13
|
+
...
|
|
14
|
+
|
|
15
|
+
"CacheStore": {
|
|
16
|
+
type: "memory", // redis or memory, memory is default
|
|
17
|
+
// key_prefix: "koatty",
|
|
18
|
+
// host: '127.0.0.1',
|
|
19
|
+
// port: 6379,
|
|
20
|
+
// name: "",
|
|
21
|
+
// username: "",
|
|
22
|
+
// password: "",
|
|
23
|
+
// db: 0,
|
|
24
|
+
// timeout: 30,
|
|
25
|
+
// pool_size: 10,
|
|
26
|
+
// conn_timeout: 30
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
...
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
used in service:
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
import { Scheduled, SchedulerLock } from "koatty_schedule";
|
|
38
|
+
|
|
39
|
+
export class TestService {
|
|
40
|
+
|
|
41
|
+
@Scheduled("0 * * * * *")
|
|
42
|
+
@SchedulerLock("testCron") //locker
|
|
43
|
+
Test(){
|
|
44
|
+
//todo
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
48
|
```
|
package/dist/LICENSE
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
BSD 3-Clause License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020, Koatty
|
|
4
|
-
All rights reserved.
|
|
5
|
-
|
|
6
|
-
Redistribution and use in source and binary forms, with or without
|
|
7
|
-
modification, are permitted provided that the following conditions are met:
|
|
8
|
-
|
|
9
|
-
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
-
list of conditions and the following disclaimer.
|
|
11
|
-
|
|
12
|
-
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
-
this list of conditions and the following disclaimer in the documentation
|
|
14
|
-
and/or other materials provided with the distribution.
|
|
15
|
-
|
|
16
|
-
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
-
contributors may be used to endorse or promote products derived from
|
|
18
|
-
this software without specific prior written permission.
|
|
19
|
-
|
|
20
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020, Koatty
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/dist/README.md
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
# koatty_schedule
|
|
2
|
-
Schedule for koatty.
|
|
3
|
-
|
|
4
|
-
Koatty框架的 Scheduled, SchedulerLock, Lock 支持库
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
# Usage
|
|
8
|
-
|
|
9
|
-
db.ts in koatty project:
|
|
10
|
-
|
|
11
|
-
```js
|
|
12
|
-
export default {
|
|
13
|
-
...
|
|
14
|
-
|
|
15
|
-
"CacheStore": {
|
|
16
|
-
type: "memory", // redis or memory, memory is default
|
|
17
|
-
// key_prefix: "koatty",
|
|
18
|
-
// host: '127.0.0.1',
|
|
19
|
-
// port: 6379,
|
|
20
|
-
// name: "",
|
|
21
|
-
// username: "",
|
|
22
|
-
// password: "",
|
|
23
|
-
// db: 0,
|
|
24
|
-
// timeout: 30,
|
|
25
|
-
// pool_size: 10,
|
|
26
|
-
// conn_timeout: 30
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
...
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
used in service:
|
|
35
|
-
|
|
36
|
-
```js
|
|
37
|
-
import { Scheduled, SchedulerLock } from "koatty_schedule";
|
|
38
|
-
|
|
39
|
-
export class TestService {
|
|
40
|
-
|
|
41
|
-
@Scheduled("0 * * * * *")
|
|
42
|
-
@SchedulerLock("testCron") //locker
|
|
43
|
-
Test(){
|
|
44
|
-
//todo
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
1
|
+
# koatty_schedule
|
|
2
|
+
Schedule for koatty.
|
|
3
|
+
|
|
4
|
+
Koatty框架的 Scheduled, SchedulerLock, Lock 支持库
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
# Usage
|
|
8
|
+
|
|
9
|
+
db.ts in koatty project:
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
export default {
|
|
13
|
+
...
|
|
14
|
+
|
|
15
|
+
"CacheStore": {
|
|
16
|
+
type: "memory", // redis or memory, memory is default
|
|
17
|
+
// key_prefix: "koatty",
|
|
18
|
+
// host: '127.0.0.1',
|
|
19
|
+
// port: 6379,
|
|
20
|
+
// name: "",
|
|
21
|
+
// username: "",
|
|
22
|
+
// password: "",
|
|
23
|
+
// db: 0,
|
|
24
|
+
// timeout: 30,
|
|
25
|
+
// pool_size: 10,
|
|
26
|
+
// conn_timeout: 30
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
...
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
used in service:
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
import { Scheduled, SchedulerLock } from "koatty_schedule";
|
|
38
|
+
|
|
39
|
+
export class TestService {
|
|
40
|
+
|
|
41
|
+
@Scheduled("0 * * * * *")
|
|
42
|
+
@SchedulerLock("testCron") //locker
|
|
43
|
+
Test(){
|
|
44
|
+
//todo
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
48
|
```
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @Author: richen
|
|
3
|
-
* @Date: 2023-
|
|
3
|
+
* @Date: 2023-07-28 21:05:22
|
|
4
4
|
* @License: BSD (3-Clause)
|
|
5
5
|
* @Copyright (c) - <richenlin(at)gmail.com>
|
|
6
6
|
* @HomePage: https://koatty.org/
|
|
@@ -107,16 +107,16 @@ class Locker {
|
|
|
107
107
|
if (this.client && !this.client.getCompare) {
|
|
108
108
|
this.client.defineCommand('getCompare', {
|
|
109
109
|
numberOfKeys: 1,
|
|
110
|
-
lua: `
|
|
111
|
-
local remote_value = redis.call("get",KEYS[1])
|
|
112
|
-
|
|
113
|
-
if (not remote_value) then
|
|
114
|
-
return 0
|
|
115
|
-
elseif (remote_value == ARGV[1]) then
|
|
116
|
-
return redis.call("del",KEYS[1])
|
|
117
|
-
else
|
|
118
|
-
return -1
|
|
119
|
-
end
|
|
110
|
+
lua: `
|
|
111
|
+
local remote_value = redis.call("get",KEYS[1])
|
|
112
|
+
|
|
113
|
+
if (not remote_value) then
|
|
114
|
+
return 0
|
|
115
|
+
elseif (remote_value == ARGV[1]) then
|
|
116
|
+
return redis.call("del",KEYS[1])
|
|
117
|
+
else
|
|
118
|
+
return -1
|
|
119
|
+
end
|
|
120
120
|
`
|
|
121
121
|
});
|
|
122
122
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @Author: richen
|
|
3
|
-
* @Date: 2023-
|
|
3
|
+
* @Date: 2023-07-28 21:05:22
|
|
4
4
|
* @License: BSD (3-Clause)
|
|
5
5
|
* @Copyright (c) - <richenlin(at)gmail.com>
|
|
6
6
|
* @HomePage: https://koatty.org/
|
|
@@ -85,16 +85,16 @@ class Locker {
|
|
|
85
85
|
if (this.client && !this.client.getCompare) {
|
|
86
86
|
this.client.defineCommand('getCompare', {
|
|
87
87
|
numberOfKeys: 1,
|
|
88
|
-
lua: `
|
|
89
|
-
local remote_value = redis.call("get",KEYS[1])
|
|
90
|
-
|
|
91
|
-
if (not remote_value) then
|
|
92
|
-
return 0
|
|
93
|
-
elseif (remote_value == ARGV[1]) then
|
|
94
|
-
return redis.call("del",KEYS[1])
|
|
95
|
-
else
|
|
96
|
-
return -1
|
|
97
|
-
end
|
|
88
|
+
lua: `
|
|
89
|
+
local remote_value = redis.call("get",KEYS[1])
|
|
90
|
+
|
|
91
|
+
if (not remote_value) then
|
|
92
|
+
return 0
|
|
93
|
+
elseif (remote_value == ARGV[1]) then
|
|
94
|
+
return redis.call("del",KEYS[1])
|
|
95
|
+
else
|
|
96
|
+
return -1
|
|
97
|
+
end
|
|
98
98
|
`
|
|
99
99
|
});
|
|
100
100
|
}
|
package/dist/package.json
CHANGED
|
@@ -1,91 +1,90 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "koatty_schedule",
|
|
3
|
-
"version": "1.5.
|
|
4
|
-
"description": "Schedule for koatty.",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
|
|
7
|
-
"build:cp": "node scripts/postBuild && copyfiles package.json LICENSE README.md dist/",
|
|
8
|
-
"build:js": "del-cli --force dist && npx rollup --bundleConfigAsCjs -c .rollup.config.js",
|
|
9
|
-
"build:doc": "del-cli --force docs/api && npx api-documenter markdown --input temp --output docs/api",
|
|
10
|
-
"build:dts": "del-cli --force temp && npx tsc && npx api-extractor run --local --verbose",
|
|
11
|
-
"eslint": "eslint --ext .ts,.js ./",
|
|
12
|
-
"prepublishOnly": "npm test && npm run build",
|
|
13
|
-
"prerelease": "npm test && npm run build",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"@commitlint/
|
|
52
|
-
"@
|
|
53
|
-
"@microsoft/api-
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@types/
|
|
57
|
-
"@types/
|
|
58
|
-
"@types/
|
|
59
|
-
"@
|
|
60
|
-
"@typescript-eslint/
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"eslint": "^
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"jest": "^
|
|
69
|
-
"
|
|
70
|
-
"rollup": "^
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"ts-
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "koatty_schedule",
|
|
3
|
+
"version": "1.5.11",
|
|
4
|
+
"description": "Schedule for koatty.",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
|
|
7
|
+
"build:cp": "node scripts/postBuild && copyfiles package.json LICENSE README.md dist/",
|
|
8
|
+
"build:js": "del-cli --force dist && npx rollup --bundleConfigAsCjs -c .rollup.config.js",
|
|
9
|
+
"build:doc": "del-cli --force docs/api && npx api-documenter markdown --input temp --output docs/api",
|
|
10
|
+
"build:dts": "del-cli --force temp && npx tsc && npx api-extractor run --local --verbose",
|
|
11
|
+
"eslint": "eslint --ext .ts,.js ./",
|
|
12
|
+
"prepublishOnly": "npm test && npm run build && git push --follow-tags origin master",
|
|
13
|
+
"prerelease": "npm test && npm run build",
|
|
14
|
+
"release": "standard-version",
|
|
15
|
+
"test": "npm run eslint && jest --passWithNoTests"
|
|
16
|
+
},
|
|
17
|
+
"main": "./dist/index.js",
|
|
18
|
+
"exports": {
|
|
19
|
+
"require": "./dist/index.js",
|
|
20
|
+
"import": "./dist/index.mjs"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/thinkkoa/koatty_schedule.git"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"schedule",
|
|
28
|
+
"koatty",
|
|
29
|
+
"thinkkoa"
|
|
30
|
+
],
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">10.0.0"
|
|
33
|
+
},
|
|
34
|
+
"author": {
|
|
35
|
+
"name": "richenlin",
|
|
36
|
+
"email": "richenlin@gmail.com"
|
|
37
|
+
},
|
|
38
|
+
"license": "BSD-3-Clause",
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/thinkkoa/koatty_schedule/issues"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/thinkkoa/koatty_schedule",
|
|
43
|
+
"maintainers": [
|
|
44
|
+
{
|
|
45
|
+
"name": "richenlin",
|
|
46
|
+
"email": "richenlin@gmail.com"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@commitlint/cli": "^17.x.x",
|
|
51
|
+
"@commitlint/config-conventional": "^17.x.x",
|
|
52
|
+
"@microsoft/api-documenter": "^7.x.x",
|
|
53
|
+
"@microsoft/api-extractor": "^7.x.x",
|
|
54
|
+
"@rollup/plugin-json": "^6.x.x",
|
|
55
|
+
"@types/cron": "^2.x.x",
|
|
56
|
+
"@types/jest": "^29.x.x",
|
|
57
|
+
"@types/koa": "^2.x.x",
|
|
58
|
+
"@types/node": "^18.x.x",
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "^5.x.x",
|
|
60
|
+
"@typescript-eslint/parser": "^5.x.x",
|
|
61
|
+
"conventional-changelog-cli": "^2.x.x",
|
|
62
|
+
"copyfiles": "^2.x.x",
|
|
63
|
+
"del-cli": "^4.x.x",
|
|
64
|
+
"eslint": "^8.x.x",
|
|
65
|
+
"eslint-plugin-jest": "^27.x.x",
|
|
66
|
+
"husky": "^4.x.x",
|
|
67
|
+
"jest": "^29.x.x",
|
|
68
|
+
"jest-html-reporters": "^3.x.x",
|
|
69
|
+
"rollup": "^3.x.x",
|
|
70
|
+
"rollup-plugin-typescript2": "^0.x.x",
|
|
71
|
+
"standard-version": "^9.x.x",
|
|
72
|
+
"ts-jest": "^29.x.x",
|
|
73
|
+
"ts-node": "^10.x.x",
|
|
74
|
+
"typescript": "^4.x.x"
|
|
75
|
+
},
|
|
76
|
+
"dependencies": {
|
|
77
|
+
"cron": "^2.4.0",
|
|
78
|
+
"koatty_container": "^1.x.x",
|
|
79
|
+
"koatty_lib": "^1.x.x",
|
|
80
|
+
"koatty_logger": "^2.x.x",
|
|
81
|
+
"koatty_store": "^1.x.x",
|
|
82
|
+
"tslib": "^2.6.1"
|
|
83
|
+
},
|
|
84
|
+
"peerDependencies": {
|
|
85
|
+
"koatty_container": "^1.x.x",
|
|
86
|
+
"koatty_lib": "^1.x.x",
|
|
87
|
+
"koatty_logger": "^2.x.x",
|
|
88
|
+
"koatty_store": "^1.x.x"
|
|
89
|
+
}
|
|
91
90
|
}
|
package/package.json
CHANGED
|
@@ -1,91 +1,90 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "koatty_schedule",
|
|
3
|
-
"version": "1.5.
|
|
4
|
-
"description": "Schedule for koatty.",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
|
|
7
|
-
"build:cp": "node scripts/postBuild && copyfiles package.json LICENSE README.md dist/",
|
|
8
|
-
"build:js": "del-cli --force dist && npx rollup --bundleConfigAsCjs -c .rollup.config.js",
|
|
9
|
-
"build:doc": "del-cli --force docs/api && npx api-documenter markdown --input temp --output docs/api",
|
|
10
|
-
"build:dts": "del-cli --force temp && npx tsc && npx api-extractor run --local --verbose",
|
|
11
|
-
"eslint": "eslint --ext .ts,.js ./",
|
|
12
|
-
"prepublishOnly": "npm test && npm run build",
|
|
13
|
-
"prerelease": "npm test && npm run build",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"@commitlint/
|
|
52
|
-
"@
|
|
53
|
-
"@microsoft/api-
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@types/
|
|
57
|
-
"@types/
|
|
58
|
-
"@types/
|
|
59
|
-
"@
|
|
60
|
-
"@typescript-eslint/
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"eslint": "^
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"jest": "^
|
|
69
|
-
"
|
|
70
|
-
"rollup": "^
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"ts-
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "koatty_schedule",
|
|
3
|
+
"version": "1.5.11",
|
|
4
|
+
"description": "Schedule for koatty.",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
|
|
7
|
+
"build:cp": "node scripts/postBuild && copyfiles package.json LICENSE README.md dist/",
|
|
8
|
+
"build:js": "del-cli --force dist && npx rollup --bundleConfigAsCjs -c .rollup.config.js",
|
|
9
|
+
"build:doc": "del-cli --force docs/api && npx api-documenter markdown --input temp --output docs/api",
|
|
10
|
+
"build:dts": "del-cli --force temp && npx tsc && npx api-extractor run --local --verbose",
|
|
11
|
+
"eslint": "eslint --ext .ts,.js ./",
|
|
12
|
+
"prepublishOnly": "npm test && npm run build && git push --follow-tags origin master",
|
|
13
|
+
"prerelease": "npm test && npm run build",
|
|
14
|
+
"release": "standard-version",
|
|
15
|
+
"test": "npm run eslint && jest --passWithNoTests"
|
|
16
|
+
},
|
|
17
|
+
"main": "./dist/index.js",
|
|
18
|
+
"exports": {
|
|
19
|
+
"require": "./dist/index.js",
|
|
20
|
+
"import": "./dist/index.mjs"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/thinkkoa/koatty_schedule.git"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"schedule",
|
|
28
|
+
"koatty",
|
|
29
|
+
"thinkkoa"
|
|
30
|
+
],
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">10.0.0"
|
|
33
|
+
},
|
|
34
|
+
"author": {
|
|
35
|
+
"name": "richenlin",
|
|
36
|
+
"email": "richenlin@gmail.com"
|
|
37
|
+
},
|
|
38
|
+
"license": "BSD-3-Clause",
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/thinkkoa/koatty_schedule/issues"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/thinkkoa/koatty_schedule",
|
|
43
|
+
"maintainers": [
|
|
44
|
+
{
|
|
45
|
+
"name": "richenlin",
|
|
46
|
+
"email": "richenlin@gmail.com"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@commitlint/cli": "^17.x.x",
|
|
51
|
+
"@commitlint/config-conventional": "^17.x.x",
|
|
52
|
+
"@microsoft/api-documenter": "^7.x.x",
|
|
53
|
+
"@microsoft/api-extractor": "^7.x.x",
|
|
54
|
+
"@rollup/plugin-json": "^6.x.x",
|
|
55
|
+
"@types/cron": "^2.x.x",
|
|
56
|
+
"@types/jest": "^29.x.x",
|
|
57
|
+
"@types/koa": "^2.x.x",
|
|
58
|
+
"@types/node": "^18.x.x",
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "^5.x.x",
|
|
60
|
+
"@typescript-eslint/parser": "^5.x.x",
|
|
61
|
+
"conventional-changelog-cli": "^2.x.x",
|
|
62
|
+
"copyfiles": "^2.x.x",
|
|
63
|
+
"del-cli": "^4.x.x",
|
|
64
|
+
"eslint": "^8.x.x",
|
|
65
|
+
"eslint-plugin-jest": "^27.x.x",
|
|
66
|
+
"husky": "^4.x.x",
|
|
67
|
+
"jest": "^29.x.x",
|
|
68
|
+
"jest-html-reporters": "^3.x.x",
|
|
69
|
+
"rollup": "^3.x.x",
|
|
70
|
+
"rollup-plugin-typescript2": "^0.x.x",
|
|
71
|
+
"standard-version": "^9.x.x",
|
|
72
|
+
"ts-jest": "^29.x.x",
|
|
73
|
+
"ts-node": "^10.x.x",
|
|
74
|
+
"typescript": "^4.x.x"
|
|
75
|
+
},
|
|
76
|
+
"dependencies": {
|
|
77
|
+
"cron": "^2.4.0",
|
|
78
|
+
"koatty_container": "^1.x.x",
|
|
79
|
+
"koatty_lib": "^1.x.x",
|
|
80
|
+
"koatty_logger": "^2.x.x",
|
|
81
|
+
"koatty_store": "^1.x.x",
|
|
82
|
+
"tslib": "^2.6.1"
|
|
83
|
+
},
|
|
84
|
+
"peerDependencies": {
|
|
85
|
+
"koatty_container": "^1.x.x",
|
|
86
|
+
"koatty_lib": "^1.x.x",
|
|
87
|
+
"koatty_logger": "^2.x.x",
|
|
88
|
+
"koatty_store": "^1.x.x"
|
|
89
|
+
}
|
|
91
90
|
}
|