pg-boss 11.0.1 → 11.0.2
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/package.json +1 -1
- package/src/attorney.js +10 -2
package/package.json
CHANGED
package/src/attorney.js
CHANGED
|
@@ -130,7 +130,7 @@ function getConfig (value) {
|
|
|
130
130
|
config.migrate = ('migrate' in config) ? config.migrate : true
|
|
131
131
|
|
|
132
132
|
applySchemaConfig(config)
|
|
133
|
-
|
|
133
|
+
applyOpsConfig(config)
|
|
134
134
|
applyScheduleConfig(config)
|
|
135
135
|
validateWarningConfig(config)
|
|
136
136
|
|
|
@@ -201,7 +201,15 @@ function applyPollingInterval (config) {
|
|
|
201
201
|
: 2000
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
function
|
|
204
|
+
function applyOpsConfig (config) {
|
|
205
|
+
assert(!('superviseIntervalSeconds' in config) || config.superviseIntervalSeconds >= 1,
|
|
206
|
+
'configuration assert: superviseIntervalSeconds must be at least every second')
|
|
207
|
+
|
|
208
|
+
config.superviseIntervalSeconds = config.superviseIntervalSeconds || 60
|
|
209
|
+
|
|
210
|
+
assert(config.superviseIntervalSeconds / 60 / 60 <= POLICY.MAX_EXPIRATION_HOURS,
|
|
211
|
+
`configuration assert: superviseIntervalSeconds cannot exceed ${POLICY.MAX_EXPIRATION_HOURS} hours`)
|
|
212
|
+
|
|
205
213
|
assert(!('maintenanceIntervalSeconds' in config) || config.maintenanceIntervalSeconds >= 1,
|
|
206
214
|
'configuration assert: maintenanceIntervalSeconds must be at least every second')
|
|
207
215
|
|