We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8345198 commit c2a905eCopy full SHA for c2a905e
nsq.go
@@ -208,6 +208,13 @@ func (w *Worker) Run() error {
208
panicChan <- p
209
}
210
}()
211
+
212
+ // re-queue the job if worker has been shutdown.
213
+ if atomic.LoadInt32(&w.stopFlag) == 1 {
214
+ msg.Requeue(-1)
215
+ return nil
216
+ }
217
218
if len(msg.Body) == 0 {
219
// Returning nil will automatically send a FIN command to NSQ to mark the message as processed.
220
// In this case, a message with an empty body is simply ignored/discarded.
0 commit comments