feat: implementar pestaña de Gestion de Cuentas y autenticacion global RADIUS con JIT provisioning
This commit is contained in:
@@ -436,11 +436,24 @@ class AgentDaemon:
|
||||
|
||||
if should_copy_local:
|
||||
dest_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
shutil.copy2(filepath, dest_path)
|
||||
logger.info(f"Successfully copied {filepath.name} to local dest {dest_path}")
|
||||
if not cloud_uploaded:
|
||||
files_copied += 1
|
||||
bytes_transferred += file_size_bytes
|
||||
# Robust write pattern inspired by Karen's Replicator 3.5.0
|
||||
temp_dest = dest_path.with_suffix(dest_path.suffix + ".tmp")
|
||||
try:
|
||||
shutil.copy2(filepath, temp_dest)
|
||||
if dest_path.exists():
|
||||
dest_path.unlink()
|
||||
temp_dest.rename(dest_path)
|
||||
logger.info(f"Successfully copied {filepath.name} to local dest {dest_path}")
|
||||
if not cloud_uploaded:
|
||||
files_copied += 1
|
||||
bytes_transferred += file_size_bytes
|
||||
except Exception as copy_err:
|
||||
if temp_dest.exists():
|
||||
try:
|
||||
temp_dest.unlink()
|
||||
except Exception:
|
||||
pass
|
||||
raise copy_err
|
||||
except Exception as ex:
|
||||
logger.error(f"Failed to copy {filepath.name} to local path {dest_dir}: {str(ex)}")
|
||||
errors_count += 1
|
||||
|
||||
Reference in New Issue
Block a user