feat: add automatic cluster sync and IPAM discovery with configurable intervals, firewall log file parsing, and enhanced flow prioritization
Add RuntimeSettingsRead/RuntimeSettingsUpdate schemas with auto_node_sync_enabled/auto_node_sync_interval_minutes/auto_ipam_sync_enabled/auto_ipam_sync_interval_minutes/last_node_auto_sync_at/last_ipam_auto_sync_at fields, implement firewall_log_lines_from_files to parse /var/log/pve-firewall.log with max_lines limit and error collection, extend collect_firewall_log
This commit is contained in:
@@ -1,12 +1,25 @@
|
||||
import time
|
||||
import asyncio
|
||||
|
||||
from app.db.session import SessionLocal
|
||||
from app.services.auto_sync import run_due_jobs
|
||||
|
||||
|
||||
async def loop() -> None:
|
||||
print("NexaFabric worker started. Auto-sync scheduler is active.", flush=True)
|
||||
while True:
|
||||
try:
|
||||
with SessionLocal() as db:
|
||||
results = await run_due_jobs(db)
|
||||
for result in results:
|
||||
print(f"auto-sync: {result}", flush=True)
|
||||
except Exception as exc:
|
||||
print(f"auto-sync failed: {exc}", flush=True)
|
||||
await asyncio.sleep(30)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
print("NexaFabric worker started. Configure Celery queues for production job execution.", flush=True)
|
||||
while True:
|
||||
time.sleep(30)
|
||||
asyncio.run(loop())
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user