Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to actively delete a delayed job before it is been consumed? #67

Open
t0ny-peng opened this issue Jan 29, 2017 · 0 comments
Open

How to actively delete a delayed job before it is been consumed? #67

t0ny-peng opened this issue Jan 29, 2017 · 0 comments

Comments

@t0ny-peng
Copy link

It's a quite weird question but it actually exists in my program. I'm designing a eBay like system, and the logic is that:

When users makes an order, they are required to pay within 30 minutes. Otherwise the order will be closed and the user cannot pay it anymore.
I'm using a delayed job to realize this. Whenever an order is made, a job with 1800 seconds delay is generated. And if the user doesn't pay with 1800s, the job will be consumed to a python script, which marks the order as closed in database and notified the user.

But normally, 80% of the orders will be paid with in 1800s. Thus without these delayed jobs being deleted, 80% of the python computation is meaningless, and at least one mysql query will be executed for each job.

What I want to know, is how to actively delete the specific delayed job stored in an tube in my order logic. Like when the user finished the payment process, the delayed job will be deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant