Skip to content

Commit

Permalink
fixed task in module.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvgamerr committed Apr 12, 2021
1 parent 6c570f0 commit 6e6b58c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@touno-io/db",
"version": "3.0.0",
"version": "3.0.1",
"description": "all database schema in touno-io project.",
"main": "index.js",
"scripts": {
Expand All @@ -18,7 +18,8 @@
"type.js",
"LICENSE",
"README.MD",
"schema/**/*"
"schema/**/*",
"task/**/*"
],
"keywords": [
"touno.io",
Expand Down
2 changes: 2 additions & 0 deletions task/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ module.exports = {
return createCronJob(name, false, Task, TaskHistory)
},
load: async (name, manual) => {
await task.open()

const { Task, TaskHistory } = task.get()
const job = await Task.findOne({ name }, '_id')
if (!job) throw new Error('task-job is not setting.')
Expand Down

0 comments on commit 6e6b58c

Please sign in to comment.