Skip to content

Commit

Permalink
WIP Fixes #158
Browse files Browse the repository at this point in the history
  • Loading branch information
dthonon committed Jun 27, 2022
1 parent f8e02b9 commit a9a9e64
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/export_vn/store_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,20 @@ def delete_place(self, place_list):
nb_delete = self._db_backend.delete_place(place_list)
return nb_delete

def post_update(self) -> None:
"""Perform post update cleanup.
Parameters
----------
"""
# Call backends if needed
if self._config.file_enabled:
self._file_backend.post_update()
if self._config.db_enabled:
self._db_backend.post_update()

return None

def log(
self,
site,
Expand Down
9 changes: 9 additions & 0 deletions src/export_vn/store_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ def delete_place(self, place_list):
# Not implemented
return None

def post_update(self) -> None:
"""Perform post update cleanup.
Parameters
----------
"""
# Not implemented
return None

def log(self, site, controler, *args, **kwargs):
"""Write download log entries to database.
Expand Down
9 changes: 9 additions & 0 deletions src/export_vn/store_postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,15 @@ def delete_place(self, place_list):

return nb_delete

def post_update(self) -> None:
"""Perform post update cleanup.
Parameters
----------
"""
logger.info(_("Performing post update cleanup"))
return None

def log(
self,
site,
Expand Down
4 changes: 4 additions & 0 deletions src/export_vn/transfer_vn.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,10 @@ def increment_download_1(ctrl, cfg_crtl_list, cfg):
)
else:
downloader.store()

# Perform post update cleanup
store_all.post_update()

logger.info(
_("%s => Ending download using controler %s"), cfg.site, downloader.name
)
Expand Down

0 comments on commit a9a9e64

Please sign in to comment.