PolicyStat / jobtastic

Make your user-responsive long-running Celery jobs totally awesomer.
http://policystat.github.com/jobtastic/
MIT License
644 stars 61 forks source link

Add field with time of last progress updating to task result dictionary #24

Open ramusus opened 11 years ago

ramusus commented 11 years ago

I'm thinking It might be useful to understand what is last time of response from worker. For example:

self.update_state(None, PROGRESS, {
            "progress_percent": progress_percent,
            "time_remaining": time_remaining,
            "time_feedback": datetime.now(),
        })

If workers accidentaly restarts, as result you will have tasks started with some already defined porgress. But it's hard to understand If any workers are processing them now or they should be assumed as died. I suppose last feedback time may help to understand if task is alive.

What do you think about this idea?

winhamwr commented 11 years ago

Hi ramusus,

I think that's an excellent idea. Implementing it would be fairly lightweight and it would definitely be useful from the client's perspective.

As far as a name, how about last_progress_update and it be a unix timestamp? Javascript has an easier time dealing with those.

-Wes

gthieleb commented 8 years ago

Can't find the last_progress_update in the code. Should this be using the on_heartbeatevent described here?

winhamwr commented 8 years ago

Hello gthieleb,

This was a proposed enhancement that was never implemented, so you won't find it in the codebase. I'd love to see it in a pull request, though!

-Wes