Add asyncssh dependency, fix scheduler datetime comparison for naive/aware timezones, and update Docker configuration to use port 8008 with proper application structure and Alembic migrations support
Tests / Backend Tests (Python) (3.10) (push) Has been cancelled
Tests / Backend Tests (Python) (3.11) (push) Has been cancelled
Tests / Backend Tests (Python) (3.12) (push) Has been cancelled
Tests / Frontend Tests (JS) (push) Has been cancelled
Tests / Integration Tests (push) Has been cancelled
Tests / All Tests Passed (push) Has been cancelled
Tests / Backend Tests (Python) (3.10) (push) Has been cancelled
Tests / Backend Tests (Python) (3.11) (push) Has been cancelled
Tests / Backend Tests (Python) (3.12) (push) Has been cancelled
Tests / Frontend Tests (JS) (push) Has been cancelled
Tests / Integration Tests (push) Has been cancelled
Tests / All Tests Passed (push) Has been cancelled
This commit is contained in:
@@ -22,4 +22,5 @@ pytest-asyncio>=0.21.0
|
||||
python-jose[cryptography]>=3.3.0
|
||||
passlib[bcrypt]>=1.7.4
|
||||
reportlab>=4.0.0
|
||||
pillow>=10.0.0
|
||||
pillow>=10.0.0
|
||||
asyncssh>=2.14.0
|
||||
@@ -665,9 +665,21 @@ class SchedulerService:
|
||||
next_exec = s.next_run_at
|
||||
next_name = s.name
|
||||
|
||||
# Statistiques 24h
|
||||
failures_24h = sum(1 for s in schedules if s.last_status == "failed" and s.last_run_at and s.last_run_at > datetime.now(timezone.utc) - timedelta(hours=24))
|
||||
executions_24h = sum(1 for s in schedules if s.last_run_at and s.last_run_at > datetime.now(timezone.utc) - timedelta(hours=24))
|
||||
# Statistiques 24h (normaliser les datetimes pour comparaison)
|
||||
now_utc = datetime.now(timezone.utc)
|
||||
cutoff_24h = now_utc - timedelta(hours=24)
|
||||
|
||||
def is_within_24h(dt) -> bool:
|
||||
"""Compare datetime en gérant les naive vs aware."""
|
||||
if dt is None:
|
||||
return False
|
||||
# Si naive, on assume UTC
|
||||
if dt.tzinfo is None:
|
||||
dt = dt.replace(tzinfo=timezone.utc)
|
||||
return dt > cutoff_24h
|
||||
|
||||
failures_24h = sum(1 for s in schedules if s.last_status == "failed" and is_within_24h(s.last_run_at))
|
||||
executions_24h = sum(1 for s in schedules if is_within_24h(s.last_run_at))
|
||||
|
||||
# Taux de succès 7 jours
|
||||
total_runs = sum(s.run_count for s in schedules)
|
||||
|
||||
Reference in New Issue
Block a user