Git Product home page Git Product logo

Comments (9)

tjchambers avatar tjchambers commented on July 28, 2024

I don't think there is, but in my scenario which sounds similar I just make a reserve request for the tube with a short timeout and check the return. If I get a TIMED_OUT response it means it was empty. I suppose you could peek, but then you would be looping.

from beaneater.

funkyboy avatar funkyboy commented on July 28, 2024

and how do you handle buried jobs? I suppose you should kick them all before declaring the tube empty when you get a TIMED_OUT response.

from beaneater.

tjchambers avatar tjchambers commented on July 28, 2024

I don't have buried jobs in my scenario, but a peek-buried or a kick on TIMED_OUT makes sense.

from beaneater.

funkyboy avatar funkyboy commented on July 28, 2024

I "solved" by creating a queue that monitors other queues. A bit "meta", but it works :)

from beaneater.

tjchambers avatar tjchambers commented on July 28, 2024

Yes, but do you have a queue to monitor the monitor queue? :)

from beaneater.

funkyboy avatar funkyboy commented on July 28, 2024

queue monitor is always there. if the monitored queue is empty the task gets archived, otherwise recreated with the same params and some delay.

from beaneater.

funkyboy avatar funkyboy commented on July 28, 2024

Stumbled upon a nasty situation. Monitor task detects a queue is empty and starts a very long upload task. I assume this will not be called anymore and it's the last operation to be performed on the queue, but for some reason a worker sometimes kicks in on exactly the same task I am performing (the upload) and starts to upload the same file again. Any hint?

from beaneater.

funkyboy avatar funkyboy commented on July 28, 2024

Uhm, I am gonna try to increase the ttr to 1800 and see how it goes.

from beaneater.

funkyboy avatar funkyboy commented on July 28, 2024

Ok, increasing a lot the ttr worked but I had to use a pretty complex if to make sure the queue is really not empty

if tube.stats.current_jobs_urgent > 0 || tube.stats.current_jobs_ready > 0 || tube.stats.current_jobs_reserved > 0 || tube.stats.current_jobs_delayed > 0 || tube.stats.current_jobs_buried > 0 || tube.stats.current_using > 0

Just peeking :ready, :buried and :delayed does not work for me.

from beaneater.

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.