Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

processing_finished filled with value but jobs has null in the array #274

Open
marcellobarile opened this issue Aug 16, 2023 · 2 comments
Open

Comments

@marcellobarile
Copy link

marcellobarile commented Aug 16, 2023

Hi,
I'm trying to consume the API but, every now and then, I get this kind of response:

{
  user: 44337,
  processing_started: '2023-08-16 06:26:46.267010',
  processing_finished: '2023-08-16 06:26:48.392812',
  user_images: [ 8467187 ],
  images: [ 19718372 ],
  jobs: [ null ],
  job_calibrations: []
}

I find it confusing because of the null value in the jobs array. Isn't it supposed to be empty? Also note that the same image returns a valid response every now and then, eg:

{
  user: 44337,
  processing_started: '2023-08-15 17:04:13.573082',
  processing_finished: '2023-08-15 17:04:18.321569',
  user_images: [ 8464685 ],
  images: [ 19718372 ],
  jobs: [ 9035968 ],
  job_calibrations: [ [ 9035968, 6861327 ] ]
}

Is there something that I'm missing?

@marcellobarile
Copy link
Author

could it be that processing_finished gets valued even though the job hasn't started yet?

@marcellobarile
Copy link
Author

I ended up polling the service until I don't get a result that has jobs without null and job_calibrations, with a maximum number of requests to not clog the API with an infinite loop, and a delay of 2,5 seconds between the retries.

I'm not sure if this is the proper way to do it, btw I would expect that processing_finished gets valued only when the whole process is done (meaning that all jobs are done).

And maybe a status field, in case something goes wrong during the process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant