Skip to content

Commit

Permalink
revert delete_zip from task_repo.delete
Browse files Browse the repository at this point in the history
  • Loading branch information
dchhabda committed Oct 22, 2024
1 parent 2e7cba3 commit 5efc970
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions pybossa/repositories/task_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ def delete(self, element):
tend = time.time()
time_delete = tend - tstart

tstart = time.time()
project = element.project
tend = time.time()
time_project = tend - tstart

tstart = time.time()
self.db.session.commit()
tend = time.time()
Expand All @@ -217,9 +222,14 @@ def delete(self, element):
tend = time.time()
time_clean_project = tend - tstart

time_total = time_delete + time_commit + time_clean_project
current_app.logger.info("Delete task profiling task %d, project %d Total time %f seconds. self._delete %f seconds, db.session.commit %f seconds, cached_projects.clean_project %f seconds",
element.id, element.project_id, time_total, time_delete, time_commit, time_clean_project)
tstart = time.time()
self._delete_zip_files_from_store(project)
tend = time.time()
time_delete_zip = tend - tstart

time_total = time_delete + time_project + time_commit + time_clean_project + time_delete_zip
current_app.logger.info("Delete task profiling task %d, project %d Total time %f seconds. self._delete %f seconds, element.project %f seconds, db.session.commit %f seconds, cached_projects.clean_project %f seconds, self._delete_zip_files_from_store %f seconds",
element.id, element.project_id, time_total, time_delete, time_project, time_commit, time_clean_project, time_delete_zip)

def delete_task_by_id(self, project_id, task_id):
from pybossa.jobs import check_and_send_task_notifications
Expand Down

0 comments on commit 5efc970

Please sign in to comment.