feat: multi-robot architecture, car-robot rename, and credit-based OCR logic spec
This commit is contained in:
22
backend/app/services/robot_manager.py
Normal file
22
backend/app/services/robot_manager.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import asyncio
|
||||
from .harvester_robot import CarHarvester # A korábbi CarHarvester-t nevezzük át így
|
||||
from .harvester_bikes import BikeHarvester
|
||||
from .harvester_trucks import TruckHarvester
|
||||
|
||||
class RobotManager:
|
||||
@staticmethod
|
||||
async def run_full_sync(db):
|
||||
"""Sorban lefuttatja az összes robotot."""
|
||||
robots = [
|
||||
CarHarvester(),
|
||||
BikeHarvester(),
|
||||
TruckHarvester()
|
||||
]
|
||||
|
||||
for robot in robots:
|
||||
try:
|
||||
await robot.run(db)
|
||||
# Pihenő a kategóriák között, hogy ne kapjunk IP-tiltást
|
||||
await asyncio.sleep(5)
|
||||
except Exception as e:
|
||||
print(f"❌ Hiba a {robot.category} robotnál: {e}")
|
||||
Reference in New Issue
Block a user