sails-hook-quest 0.0.6 → 0.0.7
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/CHANGELOG.md +7 -0
- package/lib/index.js +11 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.0.7
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Database-free Sails apps initialize Quest when the ORM hook is disabled or excluded by `loadHooks`. Apps with ORM retain its existing awaited readiness order. Initialization errors still reject Sails loading before a partial Quest API is exposed.
|
|
8
|
+
- Source `autoStart` behavior and owned CLI child scheduler suppression remain intact in the database-free path. Native Sails contracts now cover both missing-ORM configurations, timer cleanup, initialization failure, and execution-child suppression.
|
|
9
|
+
|
|
3
10
|
## 0.0.6
|
|
4
11
|
|
|
5
12
|
Quest now exposes the resident execution contract required by job-management integrations while keeping schedules in application source.
|
package/lib/index.js
CHANGED
|
@@ -97,7 +97,7 @@ function defineQuestHook(sails) {
|
|
|
97
97
|
await jobControl.stopJobs(null, context)
|
|
98
98
|
})
|
|
99
99
|
|
|
100
|
-
const
|
|
100
|
+
const initializeQuest = async () => {
|
|
101
101
|
// The owned CLI child needs the app's hooks/context, but must not start
|
|
102
102
|
// another copy of its resident schedules, even if source config enables it.
|
|
103
103
|
if (isExecutionChild()) sails.config.quest.autoStart = false
|
|
@@ -203,13 +203,17 @@ function defineQuestHook(sails) {
|
|
|
203
203
|
sails.log.info(`Quest started with ${jobs.size} scheduled job(s)`)
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
//
|
|
207
|
-
//
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
206
|
+
// Disabled/excluded hooks never emit a loaded event. Database-free apps
|
|
207
|
+
// initialize directly; apps with ORM retain its existing readiness order.
|
|
208
|
+
if (sails.hooks.orm) {
|
|
209
|
+
await new Promise((resolve, reject) => {
|
|
210
|
+
sails.after('hook:orm:loaded', () => {
|
|
211
|
+
initializeQuest().then(resolve, reject)
|
|
212
|
+
})
|
|
211
213
|
})
|
|
212
|
-
}
|
|
214
|
+
} else {
|
|
215
|
+
await initializeQuest()
|
|
216
|
+
}
|
|
213
217
|
}
|
|
214
218
|
}
|
|
215
219
|
}
|
package/package.json
CHANGED