From 054d2da313e1f302a809df5ccd7e40462d438eb4 Mon Sep 17 00:00:00 2001 From: Cristiano Urban Date: Mon, 2 May 2022 11:33:54 +0200 Subject: [PATCH] Set 'destPathList' even on job error. This should prevent RetrieveCleaner process crash. Signed-off-by: Cristiano Urban --- transfer_service/retrieve_executor.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/transfer_service/retrieve_executor.py b/transfer_service/retrieve_executor.py index 21f5546..b855231 100644 --- a/transfer_service/retrieve_executor.py +++ b/transfer_service/retrieve_executor.py @@ -343,24 +343,24 @@ class RetrieveExecutor(TaskExecutor): self.jobObj.setResults(results) + # Add a list of physical destination paths for each VOSpace node in the node list + self.logger.info("Generating physical destination paths for VOSpace nodes...") + for vospacePath in self.nodeList: + nodeInfo = self.dbConn.getOSPath(vospacePath) + baseSrcPath = nodeInfo["baseSrcPath"] + username = nodeInfo["username"] + srcPath = nodeInfo["fullPath"] + baseDestPath = self.storageRetrievePath.replace("{username}", username) + destPath = srcPath.replace(baseSrcPath, baseDestPath) + self.destPathList.append(destPath) + self.jobObj.jobInfo["destPathList"] = self.destPathList.copy() + if status == ("OK"): self.jobObj.setPhase("COMPLETED") self.jobObj.setEndTime(datetime.datetime.now().isoformat()) self.dbConn.insertJob(self.jobObj) self.logger.info("Job phase updated to COMPLETED.") - # Add a list of physical destination paths for each VOSpace node in the node list - self.logger.info("Generating physical destination paths for VOSpace nodes...") - for vospacePath in self.nodeList: - nodeInfo = self.dbConn.getOSPath(vospacePath) - baseSrcPath = nodeInfo["baseSrcPath"] - username = nodeInfo["username"] - srcPath = nodeInfo["fullPath"] - baseDestPath = self.storageRetrievePath.replace("{username}", username) - destPath = srcPath.replace(baseSrcPath, baseDestPath) - self.destPathList.append(destPath) - self.jobObj.jobInfo["destPathList"] = self.destPathList.copy() - msg = f""" ########## VOSpace data retrieval procedure summary ########## -- GitLab