@@ -37,16 +37,19 @@ declare global {
37
37
interface Tasks {
38
38
/* extend this through declaration merging */
39
39
}
40
+
40
41
interface MigrateEvent {
41
42
/**
42
43
* The client used to run the migration. Replacing this is not officially
43
44
* supported, but...
44
45
*/
45
46
client : PoolClient ;
47
+
46
48
/**
47
49
* The Postgres version number, e.g. 120000 for PostgreSQL 12.0
48
50
*/
49
51
readonly postgresVersion : number ;
52
+
50
53
/**
51
54
* Somewhere to store temporary data from plugins, only used during
52
55
* premigrate, postmigrate, prebootstrap and postbootstrap
@@ -63,6 +66,7 @@ declare global {
63
66
* @defaultValue `process.env.DATABASE_URL`
64
67
*/
65
68
connectionString ?: string ;
69
+
66
70
/**
67
71
* Maximum number of concurrent connections to Postgres; must be at least
68
72
* `2`. This number can be lower than `concurrentJobs`, however a low
@@ -75,17 +79,20 @@ declare global {
75
79
* @defaultValue `10`
76
80
*/
77
81
maxPoolSize ?: number ;
82
+
78
83
/**
79
84
*
80
85
* @defaultValue `2000` */
81
86
pollInterval ?: number ;
87
+
82
88
/**
83
89
* Whether Graphile Worker should use prepared statements. Set `false` if
84
90
* you use software (e.g. some Postgres pools) that don't support them.
85
91
*
86
92
* @defaultValue `true`
87
93
*/
88
94
preparedStatements ?: boolean ;
95
+
89
96
/**
90
97
* The database schema in which Graphile Worker's tables, functions,
91
98
* views, etc are located. Graphile Worker will create or edit things in
@@ -94,13 +101,15 @@ declare global {
94
101
* @defaultValue `graphile_worker`
95
102
*/
96
103
schema ?: string ;
104
+
97
105
/**
98
106
* The path to a directory in which Graphile Worker should look for task
99
107
* executors.
100
108
*
101
109
* @defaultValue `process.cwd() + "/tasks"`
102
110
*/
103
111
taskDirectory ?: string ;
112
+
104
113
/**
105
114
* The path to a file in which Graphile Worker should look for crontab
106
115
* schedules. See: [recurring tasks
@@ -109,13 +118,15 @@ declare global {
109
118
* @defaultValue `process.cwd() + "/crontab"`
110
119
*/
111
120
crontabFile ?: string ;
121
+
112
122
/**
113
123
* Number of jobs to run concurrently on a single Graphile Worker
114
124
* instance.
115
125
*
116
126
* @defaultValue `1`
117
127
*/
118
128
concurrentJobs ?: number ;
129
+
119
130
/**
120
131
* A list of file extensions (in priority order) that Graphile Worker
121
132
* should attempt to import directly when loading task executors from the
@@ -124,6 +135,7 @@ declare global {
124
135
* @defaultValue `[".js", ".cjs", ".mjs"]`
125
136
*/
126
137
fileExtensions ?: string [ ] ;
138
+
127
139
/**
128
140
* How long in milliseconds after a gracefulShutdown is triggered should
129
141
* Graphile Worker wait to trigger the AbortController, which should
@@ -132,6 +144,7 @@ declare global {
132
144
* @defaultValue `5_000`
133
145
*/
134
146
gracefulShutdownAbortTimeout ?: number ;
147
+
135
148
/**
136
149
* Set to `true` to use the time as recorded by Node.js rather than
137
150
* PostgreSQL. It's strongly recommended that you ensure the Node.js and
@@ -140,6 +153,7 @@ declare global {
140
153
* @defaultValue `false`
141
154
*/
142
155
useNodeTime ?: boolean ;
156
+
143
157
/**
144
158
* **Experimental**
145
159
*
@@ -151,6 +165,7 @@ declare global {
151
165
* @defaultValue `480_000`
152
166
*/
153
167
minResetLockedInterval ?: number ;
168
+
154
169
/**
155
170
* **Experimental**
156
171
*
@@ -161,6 +176,7 @@ declare global {
161
176
* @defaultValue `600_000`
162
177
*/
163
178
maxResetLockedInterval ?: number ;
179
+
164
180
/**
165
181
* **Experimental**
166
182
*
@@ -172,10 +188,12 @@ declare global {
172
188
* @defaultValue `50`
173
189
*/
174
190
getQueueNameBatchDelay ?: number ;
191
+
175
192
/**
176
193
* A Logger instance (see [Logger](https://worker.graphile.org/docs/library/logger)).
177
194
*/
178
195
logger ?: Logger ;
196
+
179
197
/**
180
198
* Provide your own Node.js `EventEmitter` in order to be able to receive
181
199
* events (see
@@ -186,6 +204,7 @@ declare global {
186
204
*/
187
205
events ?: WorkerEvents ;
188
206
}
207
+
189
208
interface Preset {
190
209
worker ?: WorkerOptions ;
191
210
}
@@ -201,6 +220,7 @@ declare global {
201
220
} ;
202
221
} ;
203
222
}
223
+
204
224
interface WorkerHooks {
205
225
/**
206
226
* Called when Graphile Worker starts up.
@@ -244,11 +264,13 @@ declare global {
244
264
* this task identifier (see `details`), you should set it.
245
265
*/
246
266
handler ?: Task ;
267
+
247
268
/**
248
269
* The string that will identify this task (inferred from the file
249
270
* path).
250
271
*/
251
272
readonly taskIdentifier : string ;
273
+
252
274
/**
253
275
* A list of the files (and associated metadata) that match this task
254
276
* identifier.
0 commit comments