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
26 lines
642 B
Python
26 lines
642 B
Python
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:
|
|
asyncio.run(loop())
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|