Skip to content

Commit

Permalink
delete task profiling: use time.perf_counter instead of time.time
Browse files Browse the repository at this point in the history
  • Loading branch information
dchhabda committed Oct 25, 2024
1 parent 94e1ce2 commit 930ade1
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions pybossa/repositories/task_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 930ade1

Please sign in to comment.