asynq
asynq copied to clipboard
[BUG] UNKNOWN: redis command error: SADD failed: redis: client is closed
Describe the bug client.Enqueue(task)
To Reproduce Steps to reproduce the behavior (Code snippets if applicable):
- Setup background processing ...
- Enqueue tasks ...
- See Error ...
- There is a low chance of this problem occurring.
How do I handle this error ?
I am getting the same thing
@linchao0815 I figured it out, the asynq.Client was closing too early.
@domgolonka
@linchao0815 I figured it out, the asynq.Client was closing too early. My case isn't it!
@linchao0815 I figured it out, the asynq.Client was closing too early.
Figure it out,Same situation, thanks
How do you fix asynq.Client was closing too early
?
How do you fix
asynq.Client was closing too early
?
When you create the client you probably have added a defer function as shown in the example. This is called too early, eg. when the enclosing function returns. You could add the defer function to the main() function so the Task Client is not closed before your main function returns.