Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

fetchVariable does not have effect on job workers #264

Closed
veckatimest opened this issue Aug 22, 2022 · 1 comment · Fixed by #267
Closed

fetchVariable does not have effect on job workers #264

veckatimest opened this issue Aug 22, 2022 · 1 comment · Fixed by #267

Comments

@veckatimest
Copy link

veckatimest commented Aug 22, 2022

There is a createWorker method of zbClient.
It uses this configuration:

export interface ZBWorkerOptions<InputVars = IInputVariables> {
	maxJobsToActivate?: number
        // ... other fields
	fetchVariable?: (keyof InputVars)[]
}

Expected Behavior

When I use fetchVariable option, I only receive specified variables in my job executor.

Current Behavior

I receive all variables

Possible Solution

Feels like library uses ActivateJobRequest from src/lib/interfaces-grpc-1.0.ts to fetch jobs.

And there is activateJobs method in the ZBWorkerBase.ts, that fetches jobs.

// some code
		const activateJobsRequest: ActivateJobsRequest = {
			maxJobsToActivate: amount,
			requestTimeout,
			timeout: this.timeout,
			type: this.taskType,
			worker: this.id,
		}

This request does not have fetchVariable in it, so I guess this is the problem (but the type does)

Steps to Reproduce

  1. create a worker
  2. add fetchVariable
  3. check what variables you received
@jwulf
Copy link
Member

jwulf commented Sep 6, 2022

This is fixed in 8.0.3 of the client library.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants