API to stop/resume/terminate a long running task

55 views
Skip to first unread message

Arpana Mehta

unread,
Oct 12, 2020, 11:32:28 AM10/12/20
to django...@googlegroups.com
Hello everybody, 
I am here looking for a solution to a problem commonly faced maybe.

I have like a huge amount of data that is being uploaded in a go. While I can keep these upload tasks under atomic decorators to avoid systemic failure but I don't have way to let the user stop the task and resume or terminate it later.

I would need suggestions on how to go about this workflow.

Would love details in the flow. I understand the basic mechanism myself but I want to write APIs to stop or resume any running bulk write/read task in my system.

Thanks and regards,
Arpana

Chetan Ganji

unread,
Oct 13, 2020, 7:23:03 AM10/13/20
to django...@googlegroups.com
Hi Aparna,

I dont know the details of your implementation. As its a bulk upload,
assuming there would be an upload form where user can put multiple files simultaneously.
One by one, each file would be uploaded to the server.

AFAIK, bulk operations are not supposed to be stopped and resumed in order to avoid inconsistency issues.
However, after each file upload you could pause and resume later if each upload is mutually exclusive.
I have an idea, check if it works for you. It can simply be implemented in the front end by using a boolean variable.
You could stop uploading if the value of boolean is false and resume if it's true.
Pause button will set it to false and Resume button will set it to true.

Answers to below questions would help anyone who wants to give better solutions.

What kind of data - csv, xls, audio, videos, etc.
How long would a typical upload operation would take?
What is the stack? frontend and backend
What is the workflow of uploading the files?

Cheers!


Regards,
Chetan Ganji
+91-900-483-4183


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAGyqUuWfaa0_ME%2BHjQx8b6nKyB0g54F0OtA8DrEvzwpqxJ013g%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages