Commit bd3154ee authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Use symlinks for hot storage points, instead of copying data.

parent 5ddca7ad
Loading
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -270,10 +270,19 @@ class RetrieveExecutor(TaskExecutor):
                        osRelParentPath += "/"
                    destDirPath = self.storageRetrievePath.replace("{username}", username) + osRelParentPath
                    os.makedirs(destDirPath, exist_ok = True)
                    if self.storageType == "cold":
                        sp = subprocess.run(["rsync", "-av", "--no-links", srcPath, destDirPath], capture_output = True)
                        if(sp.returncode or sp.stderr):
                            self.logger.error(f"FATAL: error during the copy process, returnCode = {sp.returncode}, stderr: {sp.stderr}")
                            return False
                    else:
                        destPath = destDirPath + os.path.basename(srcPath)
                        try:
                            if not os.path.islink(srcPath):
                                os.symlink(srcPath, destPath)
                        except Exception:
                            self.logger.error(f"FATAL: error while creating symlink for target '{srcPath}'")
                            return False
            
                # Remove files from file list at the end of the copy 
                for fileInfo in blockFileList: