mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-26 07:25:56 +03:00
[GH-ISSUE #297] [FEATURE REQUEST] empty taskname should not be publish #2145
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#2145
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 @victor-wzq on GitHub (Jul 20, 2021).
Original GitHub issue: https://github.com/hibiken/asynq/issues/297
Originally assigned to: @hibiken on GitHub.
i push a task with empty taskname,
but i can't comsume this task,
i think function Enqueue should check taskname
@hibiken commented on GitHub (Jul 20, 2021):
@victor-wzq thank you for creating this issue! I haven't thought about this edge case so thank you for pointing this out 👍
I think we have a couple of options:
NewTaskfunction can panic given a empty typenameEnqueuefunction can return an error if the task has an empty typenameLet me know what you think! /cc @crossworth
@crossworth commented on GitHub (Jul 20, 2021):
I think we should go with option 2.
We should avoid panic's, we dont know where the typename could came from (maybe user input or dynamic generated) and panicing makes it harder to the caller to handle it, we should avoid panic as much as possible as a library. By returning an error we can effectively tell the caller what went wrong.
I think is the best option, Enqueue already returns errors like
ErrDuplicateTask, it would be easy to handle.I dont think its a good option, can cause a lot of confusion, makes debuging harder and most of the times the task should have a typename.
@crossworth commented on GitHub (Aug 4, 2021):
@hibiken this can be closed.
@hibiken commented on GitHub (Aug 5, 2021):
Closing this. Thank you @Luqqk!