Deleting a Delayed job

665 views
Skip to first unread message

Daniel

unread,
Aug 10, 2011, 9:12:52 AM8/10/11
to beanstalk-talk
Is there any way to delete a delayed job, or modify a delayed job? I
am trying to run several commands several minutes after user action,
but if there is a duplicate job in delay, I do not want it to run
twice.

I know beanstalkd does not support deleting delayed jobs currently,
but is there any sort of work around?

- Daniel

Chad Kouse

unread,
Aug 10, 2011, 5:46:38 PM8/10/11
to beansta...@googlegroups.com
Nothing I can think of that's too elegant. You could use memcached
though and stick a record in there relating to the delayed job. Then
when you want to delete the job just delete the associated memcached
object. And when you are consuming jobs check for the associated
record in memcached first.

--chad

> --
> You received this message because you are subscribed to the Google Groups "beanstalk-talk" group.
> To post to this group, send email to beansta...@googlegroups.com.
> To unsubscribe from this group, send email to beanstalk-tal...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/beanstalk-talk?hl=en.
>

Daniel Olfelt

unread,
Aug 10, 2011, 8:21:00 PM8/10/11
to beansta...@googlegroups.com

How hard would it be to add deleting of delayed jobs? Is there a reason it isn't an option? If it's just time, I might consider trying my hand at adding it.

--Daniel

Chad Kouse

unread,
Aug 10, 2011, 8:46:06 PM8/10/11
to beansta...@googlegroups.com
From reading the protocol doc - maybe you could work around it if you know the id. You might be able to bury and then delete the job. Not sure. 

--chad

Daniel Olfelt

unread,
Aug 10, 2011, 10:29:22 PM8/10/11
to beansta...@googlegroups.com
Yeah, I thought that would work, but bury works on the same objects that delete does. I do know the ID of the job I am trying to delete from the delay queue, but when I try to delete it, even though I know it is in the queue, it returns NOT_FOUND.

--Daniel

Chad Kouse

unread,
Aug 10, 2011, 10:33:05 PM8/10/11
to beansta...@googlegroups.com
ah, so you can't bury something that's not ready yet?
--chad

Daniel

unread,
Aug 23, 2011, 12:31:14 PM8/23/11
to beanstalk-talk
For anyone interested, I have added the ability to delete delayed jobs
to a for of beanstalkd.

https://github.com/dolfelt/beanstalkd/

Hope this helps someone.

Daniel

On Aug 10, 9:33 pm, Chad Kouse <chad.ko...@gmail.com> wrote:
> ah, so you can't bury something that's not ready yet?
> --chad
>
>
>
>
>
>
>
> On Wed, Aug 10, 2011 at 10:29 PM, Daniel Olfelt <dolf...@gmail.com> wrote:
> > Yeah, I thought that would work, but bury works on the same objects that
> > delete does. I do know the ID of the job I am trying to delete from the
> > delay queue, but when I try to delete it, even though I know it is in the
> > queue, it returns NOT_FOUND.
>
> > --Daniel
>
> > On Wed, Aug 10, 2011 at 7:46 PM, Chad Kouse <chad.ko...@gmail.com> wrote:
>
> >> From reading the protocol doc - maybe you could work around it if you know
> >> the id. You might be able to bury and then delete the job. Not sure.
>
> >> --chad
>
> >> On Aug 10, 2011, at 8:21 PM, Daniel Olfelt <dolf...@gmail.com> wrote:
>
> >> How hard would it be to add deleting of delayed jobs? Is there a reason it
> >> isn't an option? If it's just time, I might consider trying my hand at
> >> adding it.
>
> >> --Daniel
> >> On Aug 10, 2011 4:46 PM, "Chad Kouse" < <chad.ko...@gmail.com>
> >> chad.ko...@gmail.com> wrote:
> >> > Nothing I can think of that's too elegant. You could use memcached
> >> > though and stick a record in there relating to the delayed job. Then
> >> > when you want to delete the job just delete the associated memcached
> >> > object. And when you are consuming jobs check for the associated
> >> > record in memcached first.
>
> >> > --chad
>
> >> > On Aug 10, 2011, at 5:25 PM, Daniel < <dolf...@gmail.com>
> >> dolf...@gmail.com> wrote:
>
> >> >> Is there any way to delete a delayed job, or modify a delayed job? I
> >> >> am trying to run several commands several minutes after user action,
> >> >> but if there is a duplicate job in delay, I do not want it to run
> >> >> twice.
>
> >> >> I know beanstalkd does not support deleting delayed jobs currently,
> >> >> but is there any sort of work around?
>
> >> >> - Daniel
>
> >> >> --
> >> >> You received this message because you are subscribed to the Google
> >> Groups "beanstalk-talk" group.
> >> >> To post to this group, send email to <beansta...@googlegroups.com>
> >> beansta...@googlegroups.com.
> >> >> To unsubscribe from this group, send email to
> >> <beanstalk-talk%2Bunsu...@googlegroups.com>
> >> beanstalk-tal...@googlegroups.com.
> >> >> For more options, visit this group at
> >> <http://groups.google.com/group/beanstalk-talk?hl=en>
> >>http://groups.google.com/group/beanstalk-talk?hl=en.
>
> >> > --
> >> > You received this message because you are subscribed to the Google
> >> Groups "beanstalk-talk" group.
> >> > To post to this group, send email to <beansta...@googlegroups.com>
> >> beansta...@googlegroups.com.
> >> > To unsubscribe from this group, send email to
> >> <beanstalk-talk%2Bunsu...@googlegroups.com>
Reply all
Reply to author
Forward
0 new messages