News for hackers. Stuff that matters.
Re:Show HN: goworker – a faster, Resque-compatible backgroun... by benmanns on Monday September 16, 2013 @10:21AM (#6393380)
How do you handle when Heroku sends a SIGTERM to kill your process? I couldn't find a way to preempt running workers, so everything running on Heroku has to finish within 10 seconds or you can lose it.
Re:Show HN: goworker – a faster, Resque-compatible backgroun... by jrallison on Monday September 16, 2013 @03:04PM (#6395121)
Hey Ben,

Author of go-workers here. On SIGTERM, I stop accepting new work, and wait for all running workers to finish before halting.

If workers take longer than the 10 seconds Heroku gives you, go-workers uses reliable queueing (using http://redis.io/commands/brpoplpush) so the job will run again next time you start up the process.

Re:Show HN: goworker – a faster, Resque-compatible backgroun... by benmanns on Monday September 16, 2013 @03:36PM (#6395358)
Okay, cool. I do the same thing on the polling side, but don't use reliable queueing yet. I think that is probably the best way to handle the failures.
Re:Show HN: goworker – a faster, Resque-compatible backgroun... by jonnii on Monday September 16, 2013 @02:05PM (#6394714)
I'm not sure tbh, we haven't had that problem yet.