FEAT: Corporate onboarding implemented with Tax ID validation (HU) and isolated NAS storage

This commit is contained in:
2026-02-07 13:42:46 +00:00
parent c59c441a40
commit 7249aa5809
23 changed files with 399 additions and 29 deletions

View File

@@ -1,5 +1,7 @@
import asyncio
from .harvester_robot import CarHarvester # A korábbi CarHarvester-t nevezzük át így
from datetime import datetime
# Frissített importok az új fájlnevekhez:
from .harvester_cars import CarHarvester
from .harvester_bikes import BikeHarvester
from .harvester_trucks import TruckHarvester
@@ -7,6 +9,8 @@ class RobotManager:
@staticmethod
async def run_full_sync(db):
"""Sorban lefuttatja az összes robotot."""
print(f"🕒 Szinkronizáció indítva: {datetime.now()}")
robots = [
CarHarvester(),
BikeHarvester(),
@@ -15,8 +19,22 @@ class RobotManager:
for robot in robots:
try:
await robot.run(db)
# Pihenő a kategóriák között, hogy ne kapjunk IP-tiltást
# Itt a robot lekéri az API-tól az ÖSSZES márkát és frissít
await robot.run(db)
await asyncio.sleep(5)
except Exception as e:
print(f"❌ Hiba a {robot.category} robotnál: {e}")
print(f"❌ Hiba a {robot.category} robotnál: {e}")
@staticmethod
async def schedule_nightly_run(db):
"""
Egyszerű ciklus, ami figyeli az időt.
Ha éjjel 2 óra van, elindítja a teljes szinkront.
"""
while True:
now = datetime.now()
# Ha hajnali 2 és 2:01 között vagyunk, indítás
if now.hour == 2 and now.minute == 0:
await RobotManager.run_full_sync(db)
await asyncio.sleep(70) # Várunk, hogy ne induljon el többször ugyanabban a percben
await asyncio.sleep(30) # 30 másodpercenként ellenőrizzük az időt