Periodically sync remote gates instead of only loading once at startup
Gates were only ever loaded from the shared database at plugin enable or /sg reload, so a server that's already running never found out about a gate another backend created afterward - the row existed in MySQL, but nothing told this JVM to look again. Reported as "no other gates on network 'main'" despite both gates being visibly present in the database. Added GateManager.refreshRemoteGates(), scheduled every cross-server.refresh-seconds (default 30) whenever cross-server is enabled: it re-queries storage off the main thread, then merges only OTHER servers' gates into gatesById on the main thread - adding new ones, removing deleted ones, and never touching this server's own gates or any live open/connected/outgoing runtime state.
This commit is contained in:
@@ -33,6 +33,12 @@ storage:
|
||||
# share gate data.
|
||||
cross-server:
|
||||
enabled: false
|
||||
# How often (in seconds) this server checks the shared database for gates other
|
||||
# servers have created, updated, or removed since it last looked. Without this, a
|
||||
# server that's already running never finds out about a gate another backend made
|
||||
# after it booted - the row exists, but nothing prompts a reload. Doesn't touch
|
||||
# this server's own gates or any live dial/open state.
|
||||
refresh-seconds: 30
|
||||
|
||||
gate:
|
||||
# Any of these materials count as the ring's frame (and count as a valid chevron
|
||||
|
||||
Reference in New Issue
Block a user