Skip to content

Commit a5ee759

Browse files
author
Evgeniy
committed
fix: Name of task class cannot be in CamelCase format when using lock
1 parent 2a9960b commit a5ee759

File tree

2 files changed

+115
-114
lines changed

2 files changed

+115
-114
lines changed

package.json

Lines changed: 113 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,115 @@
11
{
2-
"name": "adonis5-scheduler",
3-
"version": "2.0.2",
4-
"description": "This library provides an easy way to schedule recurring tasks for AdonisJS",
5-
"scripts": {
6-
"pretest": "npm run lint",
7-
"test": "node japaFile.ts",
8-
"dev": "tsc --watch",
9-
"mrm": "mrm --preset=@adonisjs/mrm-preset",
10-
"clean": "del build",
11-
"compile": "npm run lint && npm run clean && tsc && npm run copy:files",
12-
"build": "npm run compile",
13-
"prepublishOnly": "npm run build",
14-
"copy:files": "cpx 'templates/**' 'build/templates'",
15-
"lint": "eslint . --ext=.ts --fix",
16-
"format": "prettier --write .",
17-
"commit": "git-cz",
18-
"release": "np",
19-
"version": "npm run build"
20-
},
21-
"repository": {
22-
"type": "git",
23-
"url": "git+https://github.com/reg2005/adonis5-scheduler.git"
24-
},
25-
"keywords": [
26-
"AdonisJS",
27-
"scheduler",
28-
"cron",
29-
"AdonisJS 5"
30-
],
31-
"author": "cmp08@ya.ru",
32-
"license": "MIT",
33-
"bugs": {
34-
"url": "https://github.com/reg2005/adonis5-scheduler/issues"
35-
},
36-
"homepage": "https://github.com/reg2005/adonis5-scheduler#readme",
37-
"devDependencies": {
38-
"@adonisjs/ace": "^11.0.2",
39-
"@adonisjs/core": "^5.1.8",
40-
"@adonisjs/fold": "^8.1.3",
41-
"@adonisjs/logger": "^4.0.3",
42-
"@adonisjs/mrm-preset": "^4.1.0",
43-
"@types/node": "^15.12.2",
44-
"@types/node-schedule": "^1.3.1",
45-
"@types/proper-lockfile": "^4.1.1",
46-
"adonis-provider-tester": "git://github.com/VladyslavParashchenko/adonis-provider-tester.git#main",
47-
"commitizen": "^4.2.4",
48-
"cpx": "^1.5.0",
49-
"cz-conventional-changelog": "^3.3.0",
50-
"del-cli": "^3.0.1",
51-
"doctoc": "^2.0.1",
52-
"eslint": "^7.28.0",
53-
"eslint-config-prettier": "^8.3.0",
54-
"eslint-plugin-adonis": "^1.3.2",
55-
"eslint-plugin-prettier": "^3.4.0",
56-
"husky": "^6.0.0",
57-
"japa": "^3.1.1",
58-
"mrm": "^3.0.2",
59-
"np": "^7.5.0",
60-
"npm-audit-html": "^1.5.0",
61-
"pino-pretty": "^5.0.2",
62-
"prettier": "^2.3.1",
63-
"ts-node": "^10.0.0",
64-
"typescript": "^4.3.2"
65-
},
66-
"husky": {
67-
"hooks": {
68-
"pre-commit": "npm audit --production --json | ./node_modules/.bin/npm-audit-html && git add npm-audit.html && doctoc README.md --title='## Table of contents' && git add README.md",
69-
"commit-msg": "node ./node_modules/@adonisjs/mrm-preset/validateCommit/conventional/validate.js"
70-
}
71-
},
72-
"nyc": {
73-
"exclude": [
74-
"test"
75-
],
76-
"extension": [
77-
".ts"
78-
]
79-
},
80-
"main": "build/index.js",
81-
"types": "build/adonis-typings/index.d.ts",
82-
"typings": "build/adonis-typings/index.d.ts",
83-
"files": [
84-
"build/adonis-typings",
85-
"build/providers",
86-
"build/src",
87-
"build/templates",
88-
"build/commands"
89-
],
90-
"config": {
91-
"commitizen": {
92-
"path": "cz-conventional-changelog"
93-
}
94-
},
95-
"np": {
96-
"contents": ".",
97-
"anyBranch": false
98-
},
99-
"adonisjs": {
100-
"commands": [
101-
"adonis5-scheduler/build/commands"
102-
],
103-
"types": "adonis5-scheduler",
104-
"providers": [
105-
"adonis5-scheduler"
106-
]
107-
},
108-
"dependencies": {
109-
"@adonisjs/generic-exceptions": "^3.0.1",
110-
"debug": "^4.3.1",
111-
"ms": "^2.1.3",
112-
"node-schedule": "^2.0.0",
113-
"proper-lockfile": "^4.1.2"
114-
}
2+
"name": "adonis5-scheduler",
3+
"version": "2.0.3",
4+
"description": "This library provides an easy way to schedule recurring tasks for AdonisJS",
5+
"scripts": {
6+
"pretest": "npm run lint",
7+
"test": "node japaFile.ts",
8+
"dev": "tsc --watch",
9+
"mrm": "mrm --preset=@adonisjs/mrm-preset",
10+
"clean": "del build",
11+
"compile": "npm run lint && npm run clean && tsc && npm run copy:files",
12+
"build": "npm run compile",
13+
"prepublishOnly": "npm run build",
14+
"copy:files": "cpx 'templates/**' 'build/templates'",
15+
"lint": "eslint . --ext=.ts --fix",
16+
"format": "prettier --write .",
17+
"commit": "git-cz",
18+
"release": "np",
19+
"version": "npm run build"
20+
},
21+
"repository": {
22+
"type": "git",
23+
"url": "git+https://github.com/reg2005/adonis5-scheduler.git"
24+
},
25+
"keywords": [
26+
"AdonisJS",
27+
"scheduler",
28+
"cron",
29+
"AdonisJS 5"
30+
],
31+
"author": "cmp08@ya.ru",
32+
"license": "MIT",
33+
"bugs": {
34+
"url": "https://github.com/reg2005/adonis5-scheduler/issues"
35+
},
36+
"homepage": "https://github.com/reg2005/adonis5-scheduler#readme",
37+
"devDependencies": {
38+
"@adonisjs/ace": "^11.0.2",
39+
"@adonisjs/core": "^5.1.8",
40+
"@adonisjs/fold": "^8.1.3",
41+
"@adonisjs/logger": "^4.0.3",
42+
"@adonisjs/mrm-preset": "^4.1.0",
43+
"@types/node": "^15.12.2",
44+
"@types/node-schedule": "^1.3.1",
45+
"@types/proper-lockfile": "^4.1.1",
46+
"adonis-provider-tester": "git://github.com/VladyslavParashchenko/adonis-provider-tester.git#main",
47+
"commitizen": "^4.2.4",
48+
"cpx": "^1.5.0",
49+
"cz-conventional-changelog": "^3.3.0",
50+
"del-cli": "^3.0.1",
51+
"doctoc": "^2.0.1",
52+
"eslint": "^7.28.0",
53+
"eslint-config-prettier": "^8.3.0",
54+
"eslint-plugin-adonis": "^1.3.2",
55+
"eslint-plugin-prettier": "^3.4.0",
56+
"husky": "^6.0.0",
57+
"japa": "^3.1.1",
58+
"mrm": "^3.0.2",
59+
"np": "^7.5.0",
60+
"npm-audit-html": "^1.5.0",
61+
"pino-pretty": "^5.0.2",
62+
"prettier": "^2.3.1",
63+
"ts-node": "^10.0.0",
64+
"typescript": "^4.3.2"
65+
},
66+
"husky": {
67+
"hooks": {
68+
"pre-commit": "npm audit --production --json | ./node_modules/.bin/npm-audit-html && git add npm-audit.html && doctoc README.md --title='## Table of contents' && git add README.md",
69+
"commit-msg": "node ./node_modules/@adonisjs/mrm-preset/validateCommit/conventional/validate.js"
70+
}
71+
},
72+
"nyc": {
73+
"exclude": [
74+
"test"
75+
],
76+
"extension": [
77+
".ts"
78+
]
79+
},
80+
"main": "build/index.js",
81+
"types": "build/adonis-typings/index.d.ts",
82+
"typings": "build/adonis-typings/index.d.ts",
83+
"files": [
84+
"build/adonis-typings",
85+
"build/providers",
86+
"build/src",
87+
"build/templates",
88+
"build/commands"
89+
],
90+
"config": {
91+
"commitizen": {
92+
"path": "cz-conventional-changelog"
93+
}
94+
},
95+
"np": {
96+
"contents": ".",
97+
"anyBranch": false
98+
},
99+
"adonisjs": {
100+
"commands": [
101+
"adonis5-scheduler/build/commands"
102+
],
103+
"types": "adonis5-scheduler",
104+
"providers": [
105+
"adonis5-scheduler"
106+
]
107+
},
108+
"dependencies": {
109+
"@adonisjs/generic-exceptions": "^3.0.1",
110+
"debug": "^4.3.1",
111+
"ms": "^2.1.3",
112+
"node-schedule": "^2.0.0",
113+
"proper-lockfile": "^4.1.2"
114+
}
115115
}

src/Scheduler/Task.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ export class BaseTask {
3737
.split(' ')
3838
.splice(1)
3939
.map((str) => str.toLowerCase())
40-
.join(':')
40+
.join('_')
41+
.toLowerCase()
4142
}
4243
protected _getLocker(): LockerInterface {
4344
return new Locker(this.name, this.tmpPath)

0 commit comments

Comments
 (0)