File tree Expand file tree Collapse file tree 2 files changed +16
-17
lines changed Expand file tree Collapse file tree 2 files changed +16
-17
lines changed Original file line number Diff line number Diff line change @@ -195,12 +195,13 @@ export class ZodWorker<TMessageCatalog extends MessageCatalogSchema> {
195
195
) : Promise < GraphileJob > {
196
196
const task = this . #tasks[ identifier ] ;
197
197
198
- const optionsWithoutTx = omit ( options ?? { } , [ "tx" ] ) ;
198
+ const optionsWithoutTx = removeUndefinedKeys ( omit ( options ?? { } , [ "tx" ] ) ) ;
199
199
const taskWithoutJobKey = omit ( task , [ "jobKey" ] ) ;
200
200
201
+ // Make sure options passed in to enqueue take precedence over task options
201
202
const spec = {
202
- ...optionsWithoutTx ,
203
203
...taskWithoutJobKey ,
204
+ ...optionsWithoutTx ,
204
205
} ;
205
206
206
207
if ( typeof task . queueName === "function" ) {
@@ -437,3 +438,12 @@ export class ZodWorker<TMessageCatalog extends MessageCatalogSchema> {
437
438
logger . debug ( `[worker][${ this . #name} ] ${ message } ` , args ) ;
438
439
}
439
440
}
441
+
442
+ function removeUndefinedKeys < T extends object > ( obj : T ) : T {
443
+ for ( let key in obj ) {
444
+ if ( Object . prototype . hasOwnProperty . call ( obj , key ) && obj [ key ] === undefined ) {
445
+ delete obj [ key ] ;
446
+ }
447
+ }
448
+ return obj ;
449
+ }
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ export class RecurringEndpointIndexService {
19
19
environment : {
20
20
type : RuntimeEnvironmentType . PRODUCTION ,
21
21
} ,
22
-
23
22
indexings : {
24
23
none : {
25
24
createdAt : {
@@ -28,9 +27,6 @@ export class RecurringEndpointIndexService {
28
27
} ,
29
28
} ,
30
29
} ,
31
- include : {
32
- environment : true ,
33
- } ,
34
30
} ) ;
35
31
36
32
logger . debug ( "Found endpoints that haven't been indexed in the last 10 minutes" , {
@@ -39,17 +35,10 @@ export class RecurringEndpointIndexService {
39
35
40
36
// Enqueue each endpoint for indexing
41
37
for ( const endpoint of endpoints ) {
42
- await workerQueue . enqueue (
43
- "indexEndpoint" ,
44
- {
45
- id : endpoint . id ,
46
- source : "INTERNAL" ,
47
- } ,
48
- {
49
- maxAttempts :
50
- endpoint . environment . type === RuntimeEnvironmentType . DEVELOPMENT ? 1 : undefined ,
51
- }
52
- ) ;
38
+ await workerQueue . enqueue ( "indexEndpoint" , {
39
+ id : endpoint . id ,
40
+ source : "INTERNAL" ,
41
+ } ) ;
53
42
}
54
43
}
55
44
}
You can’t perform that action at this time.
0 commit comments