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 run django-rq worker via Webhook/API call #628

Open
eznix86 opened this issue Nov 11, 2023 · 1 comment
Open

How to run django-rq worker via Webhook/API call #628

eznix86 opened this issue Nov 11, 2023 · 1 comment

Comments

@eznix86
Copy link

eznix86 commented Nov 11, 2023

There are some Serverless application where running a worker is not accessible for example using Vercel.

So it would be nice to know how to run a worker temporarily via a Webhook call for example using https://cron-job.org/en/ or something similar.

@eznix86
Copy link
Author

eznix86 commented Nov 11, 2023

I have tried this:

import django_rq

def run_queue(requests):
    worker = django_rq.get_worker()
    worker.work()
    return Response({'status': 'ok'})

I receive:
Screenshot 2023-11-11 at 16 13 06

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