From 51cef88cd31d7d22802bdf03ac02d05ac3d244e9 Mon Sep 17 00:00:00 2001 From: Eg0ra Date: Thu, 19 Dec 2024 14:35:03 +0700 Subject: [PATCH] Improve docstring for update_task_status --- import_export_extensions/resources.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/import_export_extensions/resources.py b/import_export_extensions/resources.py index 16a7f93..0b81ca5 100644 --- a/import_export_extensions/resources.py +++ b/import_export_extensions/resources.py @@ -266,7 +266,16 @@ def update_task_state( ): """Update state of the current event. - Receives meta of the current task and increase the `current`. + Receives meta of the current task and increase the `current`. Task + state is updated when current item is a multiple of + `self.status_update_row_count` or equal to total number of items. + + For example: once every 1000 objects (if the current object is 1000, + 2000, 3000) or when current object is the last object, in order to + complete the import/export. + + This needed to increase the speed of import/export by reducing number + of status updates. """ if not current_task or current_task.request.called_directly: