79631787

Date: 2025-05-21 10:31:01
Score: 0.5
Natty:
Report link

just viewed your problem and I think I might have a few solutions.

  1. Try to batch process the uploaded images (presumably in batches of 5 or 10, or your own count so it doesn't form any massive waiting delays nor does it cause any throttling). This is what some real-world products use if they have a similar problem regarding overprocessing of multiple data.

  2. Another neat trick I would suggest is that, once you receive the image after being processed, you can manually change the "uploading" state to "completed" state or "processed" state. You can use a flag variable to detect if the processed image was received or not. (This doesn't entire provide a solution to the code, but makes the flow of the project uninterrupted)

Final measure: (If none of it works)

If none of my solution or yours works, you can temporarily just suspend this problem in your code by introducing a timeout function of your desired duration up to which the state must display "Uploading". Once that said time duration is crossed, you can change the state to "Processed". This works as a way to mask the presence of error in your code, but not solve it completely. Find the average time it takes for the images to get processed, and induce that time duration as your timeout duration. This will make sure that you hardcode the state to change into "processed" state once after the average time for processing an image has been crossed.

Hope this helps your case. Bye.

Reasons:
  • Whitelisted phrase (-1): Hope this helps
  • Whitelisted phrase (-1.5): You can use
  • Long answer (-1):
  • No code block (0.5):
  • Me too answer (2.5): have a similar problem
  • Low reputation (1):
Posted by: Anbuchezhiyan A.M