File tree Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -53,19 +53,23 @@ export class Postgres implements IDatabase {
53
53
} ) ;
54
54
55
55
if ( this . config . postgresReadOnly && this . config . postgresReadOnly . enabled ) {
56
- this . poolRead = new Pool ( {
57
- ...this . config . postgresReadOnly
58
- } ) ;
59
- this . poolRead . on ( "error" , ( err , client ) => {
60
- Logger . error ( err . stack ) ;
61
- this . lastPoolReadFail = Date . now ( ) ;
62
-
63
- try {
64
- client . release ( true ) ;
65
- } catch ( err ) {
66
- Logger . error ( `poolRead (postgres): ${ err } ` ) ;
67
- }
68
- } ) ;
56
+ try {
57
+ this . poolRead = new Pool ( {
58
+ ...this . config . postgresReadOnly
59
+ } ) ;
60
+ this . poolRead . on ( "error" , ( err , client ) => {
61
+ Logger . error ( err . stack ) ;
62
+ this . lastPoolReadFail = Date . now ( ) ;
63
+
64
+ try {
65
+ client . release ( true ) ;
66
+ } catch ( err ) {
67
+ Logger . error ( `poolRead (postgres): ${ err } ` ) ;
68
+ }
69
+ } ) ;
70
+ } catch ( e ) {
71
+ Logger . error ( `poolRead (postgres): ${ e } ` ) ;
72
+ }
69
73
}
70
74
71
75
if ( ! this . config . readOnly ) {
You can’t perform that action at this time.
0 commit comments