Skip to content

Commit

Permalink
fix: Name of task class cannot be in CamelCase format when using lock
Browse files Browse the repository at this point in the history
  • Loading branch information
reg2005 committed Oct 24, 2023
1 parent 2a9960b commit a5ee759
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 114 deletions.
226 changes: 113 additions & 113 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,115 +1,115 @@
{
"name": "adonis5-scheduler",
"version": "2.0.2",
"description": "This library provides an easy way to schedule recurring tasks for AdonisJS",
"scripts": {
"pretest": "npm run lint",
"test": "node japaFile.ts",
"dev": "tsc --watch",
"mrm": "mrm --preset=@adonisjs/mrm-preset",
"clean": "del build",
"compile": "npm run lint && npm run clean && tsc && npm run copy:files",
"build": "npm run compile",
"prepublishOnly": "npm run build",
"copy:files": "cpx 'templates/**' 'build/templates'",
"lint": "eslint . --ext=.ts --fix",
"format": "prettier --write .",
"commit": "git-cz",
"release": "np",
"version": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https:/reg2005/adonis5-scheduler.git"
},
"keywords": [
"AdonisJS",
"scheduler",
"cron",
"AdonisJS 5"
],
"author": "[email protected]",
"license": "MIT",
"bugs": {
"url": "https:/reg2005/adonis5-scheduler/issues"
},
"homepage": "https:/reg2005/adonis5-scheduler#readme",
"devDependencies": {
"@adonisjs/ace": "^11.0.2",
"@adonisjs/core": "^5.1.8",
"@adonisjs/fold": "^8.1.3",
"@adonisjs/logger": "^4.0.3",
"@adonisjs/mrm-preset": "^4.1.0",
"@types/node": "^15.12.2",
"@types/node-schedule": "^1.3.1",
"@types/proper-lockfile": "^4.1.1",
"adonis-provider-tester": "git:/VladyslavParashchenko/adonis-provider-tester.git#main",
"commitizen": "^4.2.4",
"cpx": "^1.5.0",
"cz-conventional-changelog": "^3.3.0",
"del-cli": "^3.0.1",
"doctoc": "^2.0.1",
"eslint": "^7.28.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-adonis": "^1.3.2",
"eslint-plugin-prettier": "^3.4.0",
"husky": "^6.0.0",
"japa": "^3.1.1",
"mrm": "^3.0.2",
"np": "^7.5.0",
"npm-audit-html": "^1.5.0",
"pino-pretty": "^5.0.2",
"prettier": "^2.3.1",
"ts-node": "^10.0.0",
"typescript": "^4.3.2"
},
"husky": {
"hooks": {
"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",
"commit-msg": "node ./node_modules/@adonisjs/mrm-preset/validateCommit/conventional/validate.js"
}
},
"nyc": {
"exclude": [
"test"
],
"extension": [
".ts"
]
},
"main": "build/index.js",
"types": "build/adonis-typings/index.d.ts",
"typings": "build/adonis-typings/index.d.ts",
"files": [
"build/adonis-typings",
"build/providers",
"build/src",
"build/templates",
"build/commands"
],
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"np": {
"contents": ".",
"anyBranch": false
},
"adonisjs": {
"commands": [
"adonis5-scheduler/build/commands"
],
"types": "adonis5-scheduler",
"providers": [
"adonis5-scheduler"
]
},
"dependencies": {
"@adonisjs/generic-exceptions": "^3.0.1",
"debug": "^4.3.1",
"ms": "^2.1.3",
"node-schedule": "^2.0.0",
"proper-lockfile": "^4.1.2"
}
"name": "adonis5-scheduler",
"version": "2.0.3",
"description": "This library provides an easy way to schedule recurring tasks for AdonisJS",
"scripts": {
"pretest": "npm run lint",
"test": "node japaFile.ts",
"dev": "tsc --watch",
"mrm": "mrm --preset=@adonisjs/mrm-preset",
"clean": "del build",
"compile": "npm run lint && npm run clean && tsc && npm run copy:files",
"build": "npm run compile",
"prepublishOnly": "npm run build",
"copy:files": "cpx 'templates/**' 'build/templates'",
"lint": "eslint . --ext=.ts --fix",
"format": "prettier --write .",
"commit": "git-cz",
"release": "np",
"version": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https:/reg2005/adonis5-scheduler.git"
},
"keywords": [
"AdonisJS",
"scheduler",
"cron",
"AdonisJS 5"
],
"author": "[email protected]",
"license": "MIT",
"bugs": {
"url": "https:/reg2005/adonis5-scheduler/issues"
},
"homepage": "https:/reg2005/adonis5-scheduler#readme",
"devDependencies": {
"@adonisjs/ace": "^11.0.2",
"@adonisjs/core": "^5.1.8",
"@adonisjs/fold": "^8.1.3",
"@adonisjs/logger": "^4.0.3",
"@adonisjs/mrm-preset": "^4.1.0",
"@types/node": "^15.12.2",
"@types/node-schedule": "^1.3.1",
"@types/proper-lockfile": "^4.1.1",
"adonis-provider-tester": "git:/VladyslavParashchenko/adonis-provider-tester.git#main",
"commitizen": "^4.2.4",
"cpx": "^1.5.0",
"cz-conventional-changelog": "^3.3.0",
"del-cli": "^3.0.1",
"doctoc": "^2.0.1",
"eslint": "^7.28.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-adonis": "^1.3.2",
"eslint-plugin-prettier": "^3.4.0",
"husky": "^6.0.0",
"japa": "^3.1.1",
"mrm": "^3.0.2",
"np": "^7.5.0",
"npm-audit-html": "^1.5.0",
"pino-pretty": "^5.0.2",
"prettier": "^2.3.1",
"ts-node": "^10.0.0",
"typescript": "^4.3.2"
},
"husky": {
"hooks": {
"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",
"commit-msg": "node ./node_modules/@adonisjs/mrm-preset/validateCommit/conventional/validate.js"
}
},
"nyc": {
"exclude": [
"test"
],
"extension": [
".ts"
]
},
"main": "build/index.js",
"types": "build/adonis-typings/index.d.ts",
"typings": "build/adonis-typings/index.d.ts",
"files": [
"build/adonis-typings",
"build/providers",
"build/src",
"build/templates",
"build/commands"
],
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"np": {
"contents": ".",
"anyBranch": false
},
"adonisjs": {
"commands": [
"adonis5-scheduler/build/commands"
],
"types": "adonis5-scheduler",
"providers": [
"adonis5-scheduler"
]
},
"dependencies": {
"@adonisjs/generic-exceptions": "^3.0.1",
"debug": "^4.3.1",
"ms": "^2.1.3",
"node-schedule": "^2.0.0",
"proper-lockfile": "^4.1.2"
}
}
3 changes: 2 additions & 1 deletion src/Scheduler/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export class BaseTask {
.split(' ')
.splice(1)
.map((str) => str.toLowerCase())
.join(':')
.join('_')
.toLowerCase()
}
protected _getLocker(): LockerInterface {
return new Locker(this.name, this.tmpPath)
Expand Down

0 comments on commit a5ee759

Please sign in to comment.