Skip to content

Commit 7a8e81f

Browse files
committed
Fix issue affecting the logger
1 parent fe6a084 commit 7a8e81f

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "strontium",
3-
"version": "2.4.9",
3+
"version": "2.4.10",
44
"description": "Strontium is a TypeScript toolkit for High Performance API servers built for Production not Projects.",
55
"main": "lib/src/index.js",
66
"types": "lib/src/index.d.ts",

src/datastore/drivers/pg/PGStore.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,13 @@ export class PGStore implements Process, SQLStore {
4949

5050
public async startup(container: Container): Promise<void> {
5151
if (this.connection === undefined) {
52-
if (container.isBound(Logger)) {
53-
this.logger = container.get(Logger)
54-
}
55-
5652
this.connection = new Pool(this.connectionOptions)
5753
this.healthyState = true
5854

5955
// Handle errors and mark the connection as unhealthy
6056
this.connection.on("error", (err) => {
61-
if (this.logger) {
57+
if (container.isBound(Logger)) {
58+
this.logger = container.get(Logger)
6259
this.logger.error("PGStore encountered an error", err)
6360
}
6461

0 commit comments

Comments
 (0)