File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,27 @@ singleton throughout your code.
80
80
- ` schema ` can be used to change the default ` graphile_worker ` schema to
81
81
something else (equivalent to ` --schema ` on the CLI)
82
82
83
+ :::warning If you use ` pgPool ` , ensure it has error handlers!
84
+
85
+ If your ` pgPool ` doesn't have error handlers then connection issues with the
86
+ database may cause your Worker process to exit prematurely.
87
+
88
+ ``` ts
89
+ import { Pool } from " pg" ;
90
+ const pool = new Pool ({
91
+ /* ... */
92
+ });
93
+
94
+ /* highlight-start */
95
+ // No action necessary
96
+ function handleError() {}
97
+ pool .on (" error" , handleError );
98
+ pool .on (" connect" , (client ) => void client .on (" error" , handleError ));
99
+ /* highlight-end */
100
+ ```
101
+
102
+ :::
103
+
83
104
## ` WorkerUtils `
84
105
85
106
A ` WorkerUtils ` instance has the following methods:
You can’t perform that action at this time.
0 commit comments