Coder Social home page Coder Social logo

[Question] How do I get job score? about exq HOT 3 CLOSED

lordhx avatar lordhx commented on May 24, 2024
[Question] How do I get job score?

from exq.

Comments (3)

ananthakumaran avatar ananthakumaran commented on May 24, 2024

You can look at the exq_ui project for sample usage. Failed jobs are stored as ZSET in redis and without score, a full search is needed to find the job O(n), which will usually timeout or cause other issues. Having score will turn it into 0(1). As for how to get the score, you can use the failed/2 to paginate (basically the way UI works).

from exq.

lordhx avatar lordhx commented on May 24, 2024

@ananthakumaran thank you for the quick answer.

I see that find_failed/4 works perfectly in exq_ui example when we already have the list of failed jobs preload. But in our case we only have jid that was returned by enqueue. We use find_failed/2 and find_retry/2 for troubleshooting.

I feel like finding job by only jid is still might be useful. Could we undeprecate these functions?

Just found out that find_failed/2 does the same work as failed/2 does under the hood. Now I know how to implement workaround for us

from exq.

ananthakumaran avatar ananthakumaran commented on May 24, 2024

It only works if you have a small number of jobs in the retry queue. I understand this is very much desired, but the way data is stored (list, zset), we don't have an easy way to lookup based on jid. Doing any kind of scan on a system with a lot of jobs will bring other series issues (timeout, memory issues etc). These functions were used by the older version of exq_ui which didn't have proper pagination etc. Now we have solved those issues and marked the problematic apis as deprecated.

from exq.

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.