Remove __pycache__ files and update nodes.py to enhance sync status logic
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
__pycache__/
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -72,11 +72,18 @@ def determine_sync_status(node_name: str, last_restore_date: Optional[datetime]
|
|||||||
# Si la última sincronización es más reciente que el archivo
|
# Si la última sincronización es más reciente que el archivo
|
||||||
if last_restore_date > file_mod_time:
|
if last_restore_date > file_mod_time:
|
||||||
return EstadoSincronizacion.ACTUALIZADA.value
|
return EstadoSincronizacion.ACTUALIZADA.value
|
||||||
|
|
||||||
|
# Si la última restauración fue hace más de 5 horas, continuar
|
||||||
|
if datetime.now() - last_restore_date > timedelta(hours=5):
|
||||||
|
# Pasaron más de 5 horas, continuar el proceso
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
# Aún dentro de las 5 horas → seguir procesando
|
||||||
|
return EstadoSincronizacion.PROCESANDO.value
|
||||||
|
|
||||||
except OSError:
|
except OSError:
|
||||||
# Si hay error leyendo el archivo, asumir procesando
|
# Si hay error leyendo el archivo, asumir procesando
|
||||||
pass
|
return EstadoSincronizacion.PROCESANDO.value
|
||||||
|
|
||||||
return EstadoSincronizacion.PROCESANDO.value
|
|
||||||
|
|
||||||
# Si no existe en ninguna ruta SFTP, usar lógica basada en fechas de restauración
|
# Si no existe en ninguna ruta SFTP, usar lógica basada en fechas de restauración
|
||||||
if last_restore_date is None:
|
if last_restore_date is None:
|
||||||
|
|||||||
Reference in New Issue
Block a user