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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/attorney.js +10 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg-boss",
3
- "version": "11.0.1",
3
+ "version": "11.0.2",
4
4
  "description": "Queueing jobs in Postgres from Node.js like a boss",
5
5
  "main": "./src/index.js",
6
6
  "engines": {
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
- applyMaintenanceConfig(config)
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 applyMaintenanceConfig (config) {
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