diff --git a/package-lock.json b/package-lock.json index 035e494..b0d5e0f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@touno-io/db", - "version": "3.0.0", + "version": "3.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 40e148e..e8c34c5 100644 --- a/package.json +++ b/package.json @@ -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": { @@ -18,7 +18,8 @@ "type.js", "LICENSE", "README.MD", - "schema/**/*" + "schema/**/*", + "task/**/*" ], "keywords": [ "touno.io", diff --git a/task/index.js b/task/index.js index f36620d..554ff86 100644 --- a/task/index.js +++ b/task/index.js @@ -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.')