Skip to content

Commit

Permalink
fix(worker): Fix invalid subscription triggered in the worker loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentdesmares committed Apr 22, 2024
1 parent 27e75b3 commit f92724b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
5 changes: 1 addition & 4 deletions lib/worker/checkForJobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ function checkForJobs(args) {
args.workerId = (0, uuid_1["default"])();
}
processingFunction = args.processingFunction, client = args.client, typeList = args.typeList, _a = args.workerId, workerId = _a === void 0 ? undefined : _a, workerType = args.workerType, _b = args.looping, looping = _b === void 0 ? true : _b, _c = args.loopTime, loopTime = _c === void 0 ? DEFAULT_LOOP_TIME : _c, _d = args.isCancelledOnCancelRequest, isCancelledOnCancelRequest = _d === void 0 ? false : _d, _e = args.nonBlocking, nonBlocking = _e === void 0 ? false : _e;
client.subscribe({
query: (0, graphql_tag_1["default"])(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n subscription {\n job: jobUpdate {\n id\n type\n name\n input\n output\n status\n }\n }\n "], ["\n subscription {\n job: jobUpdate {\n id\n type\n name\n input\n output\n status\n }\n }\n "])))
});
return [4 /*yield*/, client.mutate({
mutation: acquireJobQuery,
variables: { typeList: typeList, workerId: workerId, workerType: workerType }
Expand Down Expand Up @@ -214,4 +211,4 @@ function checkForJobs(args) {
});
}
exports["default"] = checkForJobs;
var templateObject_1, templateObject_2;
var templateObject_1;
15 changes: 0 additions & 15 deletions src/worker/checkForJobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,21 +134,6 @@ export default async function checkForJobs(args: {
nonBlocking = false
} = args

client.subscribe({
query: gql`
subscription {
job: jobUpdate {
id
type
name
input
output
status
}
}
`,
})

const { data } = await client.mutate({
mutation: acquireJobQuery,
variables: { typeList, workerId, workerType },
Expand Down

0 comments on commit f92724b

Please sign in to comment.