pg-boss 11.0.0 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg-boss",
3
- "version": "11.0.0",
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
 
package/src/plans.js CHANGED
@@ -715,7 +715,7 @@ function insertJobs (schema, { table, name, returnId = true }) {
715
715
  WHEN right("startAfter", 1) = 'Z' THEN CAST("startAfter" as timestamp with time zone)
716
716
  ELSE now() + CAST(COALESCE("startAfter",'0') as interval)
717
717
  END as start_after
718
- FROM json_to_recordset($1) as x (
718
+ FROM json_to_recordset($1::json) as x (
719
719
  id uuid,
720
720
  name text,
721
721
  priority integer,