Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,9 @@ class Manager extends EventEmitter {
return options.db
}

assert(this.db._pgbdb && this.db.opened, 'Database connection is not opened')
// Custom db objects (without _pgbdb flag) are assumed to be ready
// Only check opened flag for pg-boss managed db instances
assert(!this.db._pgbdb || (this.db._pgbdb && this.db.opened), 'Database connection is not opened')

return this.db
}
Expand Down
Loading