nansencenter / django-geo-spaas-harvesting

Harvest data into a GeoSPaaS catalog
GNU General Public License v3.0
1 stars 1 forks source link

Retry when ftp connection is lost #52

Closed aperrin66 closed 4 years ago

aperrin66 commented 4 years ago

Resolves #51

Added a decorator which re-initializes the FTP connection if it times out.

aperrin66 commented 4 years ago

It is up to you to decide, but I think it is better to have that decorator for the _is_file function as well. I mean putting the @Decorators.retry_on_timeout above the self._list_folder_contents(folder_path):. I suggest it because of the nature of that decorator. Maybe you thought that this action of _is_file is very very fast and do not need to ensure the connection.

It's not needed for _is_file(), because there is no FTP operation in this method, it's just a check on the path.