Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(worker): process job when closing and it was moved to active #3042

Closed
wants to merge 2 commits into from

Conversation

roggervalf
Copy link
Collaborator

Why

  1. Why is this change necessary? When a job is moved to active, even when closing. We need to try to process it. If not, we will create stalled jobs

How

  1. How did you implement this? Remove closing check when processing a job

Additional Notes (Optional)

Any extra info here.

@@ -819,7 +826,7 @@ will never work with more accuracy than 1ms. */
fetchNextCallback = () => true,
jobsInProgress: Set<{ job: Job; ts: number }>,
): Promise<void | Job<DataType, ResultType, NameType>> {
if (!job || this.closing || this.paused) {
if (!job) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed, as the signature of this method already guarantees that the job cannot be undefined or null

@@ -88,7 +88,7 @@ else
end
end

local deduplicationJobId = deduplicateJob(args[1], opts['de'],
local deduplicationJobId = deduplicateJob(opts['de'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated fix?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable, not a fix, just re formatting

]]

local function deduplicateJob(prefixKey, deduplicationOpts, jobId, deduplicationKey, eventsKey, maxEvents)
local function deduplicateJob(deduplicationOpts, jobId, deduplicationKey, eventsKey, maxEvents)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems to be an unrelated fix.

@roggervalf
Copy link
Collaborator Author

Closed in favor of #3059

@roggervalf roggervalf closed this Feb 7, 2025
@roggervalf roggervalf deleted the fix-worker-process-job-when-is-active branch February 7, 2025 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants