From 930ade112b64449aa42b53944e4127ced7ea2ae3 Mon Sep 17 00:00:00 2001 From: dchhabda Date: Fri, 25 Oct 2024 13:29:55 -0400 Subject: [PATCH] delete task profiling: use time.perf_counter instead of time.time --- pybossa/repositories/task_repository.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pybossa/repositories/task_repository.py b/pybossa/repositories/task_repository.py index 46c74c26e..c7f062dcb 100644 --- a/pybossa/repositories/task_repository.py +++ b/pybossa/repositories/task_repository.py @@ -202,29 +202,29 @@ def update(self, element): raise DBIntegrityError(e) def delete(self, element): - tstart = time.time() + tstart = time.perf_counter() self._delete(element) - tend = time.time() + tend = time.perf_counter() time_delete = tend - tstart - tstart = time.time() + tstart = time.perf_counter() project = element.project - tend = time.time() + tend = time.perf_counter() time_project = tend - tstart - tstart = time.time() + tstart = time.perf_counter() self.db.session.commit() - tend = time.time() + tend = time.perf_counter() time_commit = tend - tstart - tstart = time.time() + tstart = time.perf_counter() cached_projects.clean_project(element.project_id) - tend = time.time() + tend = time.perf_counter() time_clean_project = tend - tstart - tstart = time.time() + tstart = time.perf_counter() self._delete_zip_files_from_store(project) - tend = time.time() + tend = time.perf_counter() time_delete_zip = tend - tstart time_total = time_delete + time_project + time_commit + time_clean_project + time_delete_zip