mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-25 23:15:51 +03:00
[GH-ISSUE #568] [FEATURE REQUEST] Update Task #1284
Labels
No labels
CLI
bug
designing
documentation
duplicate
enhancement
good first issue
good first issue
help wanted
idea
invalid
investigate
needs-more-info
performance
pr-welcome
pull-request
question
wontfix
work in progress
work in progress
work-around-available
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/asynq#1284
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @endrawanandika on GitHub (Nov 2, 2022).
Original GitHub issue: https://github.com/hibiken/asynq/issues/568
Originally assigned to: @hibiken on GitHub.
Is your feature request related to a problem? Please describe.
I have enqueued delayed task
But after some time, I want to update the time for that task to be processed (can be earlier or later). The Task that is created have task id (or I can get from
info.ID), so I want to be able to update it in the future.I can do delete task and enqueue again,
but if somehow I can't enqueue after delete task, the task will be lost. This will be a trouble if there are checking if task exist before update, so retrying doesn't work.
Another approach that I can think of is create task
UpdateTask, that will do:with enqueue
UpdateTasklike this:So the retrying just need to be retried from Delete, not checking if task exist.
Beside that, I can also save task payload somewhere else so I can refer it.
I think the library should be able to do atomic update.
Let me know if there are missing docs that I haven't read to fulfill my requirements.
Describe the solution you'd like
It can also return err if the task isn't exist, so I know that it's updated or not (I don't want enqueue non existant task).
Describe alternatives you've considered
asynq.UpdateIfExist(true).DeleteTaskandEnqueuecan be 1 atomic operation.Additional context
@184104489 commented on GitHub (Jan 4, 2023):
@hibiken Any news? I long for this feature. Thanks for your work
@marcown commented on GitHub (Jan 4, 2023):
@hibiken I would also be interested. Do you need any help or could you sketch your idea how you would do it? It would also be useful for me not only to update a delayed task but also to update the payload of a running task
@ray2011 commented on GitHub (Apr 11, 2023):
This is a useful feature.
@dedisuryadi commented on GitHub (Jul 8, 2023):
Having the ability to edit the payload would also be nice
@aziz-the-dev commented on GitHub (Mar 17, 2025):
Hi, I'm working on task payload update functionality. For now, only scheduled tasks can be updated with my implementation of the update task. Haven't tested it properly; also, I'm new to this library, so it's possible for me to miss some internal logic.
I used Inspector.DeleteTask is the starting point for this. It would be nice if someone with more experience could guide me with the internal structure of the library.