def process(self):
"""
Process response files
"""
try:
with self.sftp.cd(settings.EXAMS_SFTP_RESULTS_DIR):
for remote_path, local_path in self.filtered_files():
try:
if self.process_zip(local_path):
self.sftp.remove(remote_path)
log.debug("Processed remote file: %s", remote_path)
except (EOFError, SSHException,):
raise
except: # pylint: disable=bare-except
log.exception("Error processing file: %s", remote_path)
finally:
if os.path.exists(local_path):
os.remove(local_path)
except (EOFError, SSHException,) as exc:
raise RetryableSFTPException("Exception processing response files") from exc
评论列表
文章目录