Skip to content

Commit c02e084

Browse files
committed
only assert opened state for in-house db connections
1 parent 329d94a commit c02e084

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/manager.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -680,9 +680,9 @@ class Manager extends EventEmitter {
680680
return options.db
681681
}
682682

683-
// 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')
683+
if (this.db._pgbdb) {
684+
assert(this.db.opened, 'Database connection is not opened')
685+
}
686686

687687
return this.db
688688
}

0 commit comments

Comments
 (0)