There was an error while loading. Please reload this page.
2 parents d6405e0 + eed1dea commit 329d94aCopy full SHA for 329d94a
1 file changed
src/manager.js
@@ -680,7 +680,9 @@ class Manager extends EventEmitter {
680
return options.db
681
}
682
683
- assert(this.db._pgbdb && this.db.opened, 'Database connection is not opened')
+ // Custom db objects (without _pgbdb flag) are assumed to be ready
684
+ // Only check opened flag for pg-boss managed db instances
685
+ assert(!this.db._pgbdb || (this.db._pgbdb && this.db.opened), 'Database connection is not opened')
686
687
return this.db
688
0 commit comments