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

Pending tasks are not cleared #233

Closed
callumforrester opened this issue May 24, 2023 · 3 comments · Fixed by #386
Closed

Pending tasks are not cleared #233

callumforrester opened this issue May 24, 2023 · 3 comments · Fixed by #386
Assignees
Labels
bug Something isn't working worker Relates to worker code

Comments

@callumforrester
Copy link
Collaborator

Tasks are currently only removed from pending_tasks when clear_task is called on it, meaning pending_tasks contain tasks that are not is_pending, and various states of is_complete/is_error.
I think we need pending_tasks, active_task, finished_tasks eventually.

@callumforrester
Copy link
Collaborator Author

Apologies for past-me's unclear rambling, but I think this means we should rename worker.pending_tasks to simply worker.tasks, since not all of them are, in fact, pending (some are already done, for example)

@stan-dot stan-dot added the worker Relates to worker code label Mar 8, 2024
@stan-dot stan-dot self-assigned this Mar 8, 2024
@stan-dot
Copy link
Collaborator

`
class TrackableTask(BlueapiBaseModel, Generic[T]):
"""
A representation of a task that the worker recognizes
"""

task_id: str
task: T
is_complete: bool = False
is_pending: bool = True
errors: List[str] = Field(default_factory=list)`

what could also change - the name of the TrackableTask or the property that is accessed with `.task`. that Writing task.task is odd. Maybe taskdata? or just 'data'?

@stan-dot stan-dot linked a pull request Mar 12, 2024 that will close this issue
@stan-dot
Copy link
Collaborator

adding tests to pass coverage check

stan-dot added a commit that referenced this issue Mar 14, 2024
ZohebShaikh pushed a commit that referenced this issue May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working worker Relates to worker code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants