question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JSON API Method to update the job's progress

See original GitHub issue

Hello all,

Thank for this awesome tool. I have patched the code in order to modify with JSON API the jobs’s progress

Sorry i feel unconfortable with git so I copy/paste my code here.

In ./lib/http/routes/json.js

/**
 * Update job :id :frames :totalFrames.
 */

exports.updateProgress = function(req, res){
  var id = req.params.id
    , frames = req.params.frames , totalFrames = req.params.totalFrames;

  Job.get(id, function(err, job){
    if (err) return res.send({ error: err.message });
    job.progress(frames, totalFrames);
    job.save(function(err){
      if (err) return res.send({ error: err.message });
      res.send({ message: 'updated Progress' });
    });
  });


};

And in ./lib/http/index.js

app.put('/job/:id/progress/:frames..:totalFrames', provides('json'), json.updateProgress);

Here an example:

curl -X PUT “http://domain:port/job/163/progress/1200…3000”

Sorry for my english.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
PaulMalycommented, Sep 5, 2017

@behrad I don’t agree with you. It’s very useful feature.

Right now JSON API is completely unuseful and it’s sad. Kue as a stand-alone (micro-)service is much more preferable than just a nodejs module. And it’s simple to move Kue this way - just make JSON API more powerful.

0reactions
behradcommented, Mar 11, 2014

This is unusual feature, since kue job processors are in nodejs, and worker is the one how can change job’s progress. If you are using a bridged PHP/Java/XYZ handler, you can also define a bridge between your nodejs processor and your PHP script to update the job’s progress within the your nodejs code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Update Job (for data collection and evaluation) - TechDocs
Update Job (for data collection and evaluation). Last Updated October 2, 2022. Use this API to update a job in which a technical...
Read more >
how to get progress bar data for a running jenkins job through ...
I can find information on the last build ( .../job/MyJob/lastBuild/api/xml ) but I'm not seeing the field(s) that would let me create a...
Read more >
REST API - Chronos
You can communicate with Chronos using a RESTful JSON API over HTTP. ... Scheduled Job; Adding a Dependent Job; Adding a Docker Job;...
Read more >
Jobs, Tasks, and Schedules Methods - Tableau Help
Using the jobs, tasks, and schedules methods of the Tableau Server REST API you can do the operations listed in the following categories:...
Read more >
Jobs - Update - REST API (Azure Media Services)
Update Job Update is only supported for description and priority. ... The progress and state can be obtained by polling a Job or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found