Coder Social home page Coder Social logo

Comments (7)

abhisuri97 avatar abhisuri97 commented on July 28, 2024

http://python-rq.org/docs/results/ go to section on timeouts. flask-base currently doesn't support the functionality to set custom timeouts, but it seems simple enough to do.

from flask-base.

Mattpwinchester avatar Mattpwinchester commented on July 28, 2024

Thanks, that took care of timeouts for me. Now I just need to figure out how to get flask-base to have more than one redis queue worker active at a time. Is that something I can configure in the Local file or something I should have in manage.py?

from flask-base.

abhisuri97 avatar abhisuri97 commented on July 28, 2024

Yep. Just edit the Local file and I think you should be able to specify more workers (e.g. worker1, worker2 et al). Though I think this may be an anti pattern. Ideally, I think you would want to do something like listening for different types of worker queue calls. Ref http://python-rq.org/docs/workers/

from flask-base.

Mattpwinchester avatar Mattpwinchester commented on July 28, 2024

Do I have to specifiy the names for each worker? Can I say worker: python -u manage.py run_worker 100 to spin up 100 workers?

from flask-base.

abhisuri97 avatar abhisuri97 commented on July 28, 2024

Oh sorry, I should mention that though you can technically create 100+ workers...they all connect to the same port. You are probably going to need to do some more significant editing of the code in order to get multiple queues to work concurrently. I defer to @sandlerben for this since he implemented the worker code.

from flask-base.

Mattpwinchester avatar Mattpwinchester commented on July 28, 2024

Oh sorry, I should mention that though you can technically create 100+ workers...they all connect to the same port. You are probably going to need to do some more significant editing of the code in order to get multiple queues to work concurrently. I defer to @sandlerben for this since he implemented the worker code.

I tried spinning up 100 workers and I got the following error along with the server unable to start:

13:53:14 worker.1 | usage: manage.py [-?]
13:53:14 worker.1 | {reset,shell,setup_dev,format,rebuild,db,add_fake_data,runserver,setup_prod,test,recreate_db,run_worker,process_datasets}
13:53:14 worker.1 | ...
13:53:14 worker.1 | manage.py: error: too many arguments
13:53:14 worker.1 | exited with code 2

My Local file:

redis: redis-server
web: python -u manage.py runserver --host 127.0.0.1 --port 8001
worker: python -u manage.py run_worker 100

Please tell me what I need to change in order to have more than one worker currently running.

from flask-base.

sandlerben avatar sandlerben commented on July 28, 2024

My experience with python-rq is actually fairly basic, so I'm not sure I'm well-equipped to answer this question. You will be best off asking this question on another forum, such as https://github.com/nvie/rq/issues or https://stackoverflow.com/questions/tagged/python-rq. Note that flask-rq, the library which flask-base uses to interface with python-rq, is just a slim wrapper around the standard python-rq library.

from flask-base.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.