Skip to content

feat(job): add moveToCompleted method [python] #3251

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

roggervalf
Copy link
Collaborator

@roggervalf roggervalf commented May 7, 2025

Why

  1. Why is this change necessary? In order to provide a way to do manual processing. moveToComplete method is not exposed in job instance

How

  1. How did you implement this? Add moveToCompleted method in job instance and allow manual processing

Additional Notes (Optional)

Any extra info here.

@roggervalf roggervalf force-pushed the feat-job-move-to-completed branch from 5bf5d2b to c145d61 Compare May 9, 2025 04:52
@roggervalf roggervalf requested review from Copilot and manast May 9, 2025 04:53
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new moveToCompleted method on the Job instance to support manual processing.

  • Adds moveToCompleted tests for both JavaScript and Python workers.
  • Refactors related functions in the Scripts and Worker modules to simplify moveToCompleted/Failed processing.
  • Updates the Job class to expose the new moveToCompleted behavior.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_worker.ts Adds assertions on attemptsMade and finishedOn for JS tests.
python/tests/worker_test.py Introduces a test for manual processing and verifies job properties.
python/bullmq/worker.py Updates moveToCompleted invocation; removes unused opts parameter.
python/bullmq/scripts.py Refactors moveToCompleted and moveToFailed methods and their args.
python/bullmq/job.py Implements moveToCompleted to update job status and properties.

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.

1 participant