Skip to content

Job progress only updates via messages #43

Closed

Description

@patriceperez

While trying to get the job progress via the Queue.getJob() API, the progress is always 0

Here is the reproduction: https://tonicdev.com/56dc46f40ba4470d0091e3c2/56dc46f40ba4470d0091e3c3

(please note that the redis instance connection is through a free service for the reproduction to work, so if you get a connection error just retry to run the provided code)

perhaps I'm doing something wrong?

Activity

  1. patriceperez commented on Mar 15, 2016

    @patriceperez
    Author

    @LewisJEllis did you get a chance to look at this?

  2. Americas commented on Apr 12, 2016

    @Americas

    I might be mistaken, but it seems to be sync/async problems. Due to the for loop.

    https://tonicdev.com/570cd3203b688414008b3d6f/bee

  3. patriceperez commented on Apr 12, 2016

    @patriceperez
    Author

    @Americas
    how do you mean?

  4. Americas commented on Apr 12, 2016

    @Americas

    a for loop is synchronous, so when it calls other functions, they will be added to a function queue, and only run when the current function stops.

    But to check job progress you can just use the job.on("progress", function(){} ) and it works by events.

  5. patriceperez commented on Apr 12, 2016

    @patriceperez
    Author

    yeah, that is established - however on redis the key for the job details
    does not update with the progress nor the status at the moment.

    I know the status issue has been resolved but was not released yet though...

  6. Americas commented on Apr 12, 2016

    @Americas

    Well, it worked on my tweaked version of your code

  7. patriceperez commented on Apr 12, 2016

    @patriceperez
    Author

    all your iterations still output 0 as the progress, am I missing something?

  8. Americas commented on Apr 12, 2016

    @Americas

    when I run it, although it has a delay, the progress is updated.

    The first tick shows 0, the second 25, and the last has 75.

  9. patriceperez commented on Apr 12, 2016

    @patriceperez
    Author

    I'm not seeing it - when I run your code it outputs progress as 0 until the job is done, which gets progress up to 100 instantly

  10. skeggse commented on Jul 20, 2017

    @skeggse
    Member

    I'll add a unit test for this functionality in #64.

  11. added this to the 1.0.0 milestone on Jul 20, 2017
  12. removed this from the 1.0.0 milestone on Aug 9, 2017
  13. skeggse commented on Aug 9, 2017

    @skeggse
    Member

    This is indeed the current behavior. Feel free to submit a PR to change this behavior. Also open to documentation PRs if you think this behavior is unclear from the README.

  14. primadi commented on Nov 28, 2017

    @primadi

    I have long job process, so my scenario is :

    1. call queue.createJob and return jobId to client
    2. using timer, from client, call queue.getJob to ask progress, but like this issues, progress always 0.

    Perhaps I am doing wrong ? what is right scenario for my problem ?

  15. primadi commented on Nov 28, 2017

    @primadi

    looking to source code, reportProgress communicate using event, not updating job progress..

    Am I have to track progress manually, or there is another way ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions