Initial commit - Migrated to Dev environment

This commit is contained in:
2026-02-03 19:55:45 +00:00
commit a34e5b7976
3518 changed files with 481663 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import os
import time
from datetime import datetime, timedelta
class MaintenanceService:
@staticmethod
async def cleanup_old_files(storage_path: str):
"""1 évnél régebbi fájlok törlése a NAS-ról"""
limit = datetime.now() - timedelta(days=365)
for root, dirs, files in os.walk(storage_path):
for file in files:
file_path = os.path.join(root, file)
file_time = datetime.fromtimestamp(os.path.getmtime(file_path))
if file_time < limit:
os.remove(file_path)
print(f"🗑️ Törölve (lejárt): {file}")
@staticmethod
async def delete_validated_evidence(service_id: int, photo_path: str):
"""Döntésed: Validáció után a szervizkép törölhető"""
if os.path.exists(photo_path):
os.remove(photo_path)
# Logoljuk az adatbázisba, hogy a kép már nincs meg, de az adat valid