feat: Standardize sync frequency to minutes, remove Baïkal service from Docker Compose, and utilize a pre-built image for the sync container.
This commit is contained in:
@@ -6,8 +6,9 @@ import os
|
||||
import time
|
||||
|
||||
# --- CONFIGURACIÓN ---
|
||||
# Default to 5 minutes (300 seconds)
|
||||
SYNC_FREQUENCY = int(os.getenv("SYNC_FREQUENCY", 300))
|
||||
# Default to 5 minutes
|
||||
SYNC_FREQUENCY_MINUTES = int(os.getenv("SYNC_FREQUENCY", 5))
|
||||
SYNC_FREQUENCY_SECONDS = SYNC_FREQUENCY_MINUTES * 60
|
||||
|
||||
# Tu URL de Outlook
|
||||
ICS_URL = os.getenv("ICS_URL")
|
||||
@@ -95,8 +96,8 @@ def sync():
|
||||
print(f"!!! Error en Baïkal: {e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Iniciando servicio de sincronización. Frecuencia: {SYNC_FREQUENCY} segundos.")
|
||||
print(f"Iniciando servicio de sincronización. Frecuencia: {SYNC_FREQUENCY_MINUTES} minutos ({SYNC_FREQUENCY_SECONDS} segundos).")
|
||||
while True:
|
||||
sync()
|
||||
print(f"[{datetime.now()}] Durmiendo {SYNC_FREQUENCY} segundos...")
|
||||
time.sleep(SYNC_FREQUENCY)
|
||||
print(f"[{datetime.now()}] Durmiendo {SYNC_FREQUENCY_MINUTES} minutos...")
|
||||
time.sleep(SYNC_FREQUENCY_SECONDS)
|
||||
|
||||
Reference in New Issue
Block a user