Skip to content

Commit

Permalink
setup HA middleware connection on service restart (#13971)
Browse files Browse the repository at this point in the history
  • Loading branch information
yocalebo authored Jul 3, 2024
1 parent d6dc519 commit 7687364
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,12 @@ def sync(self, iface, internal_ip):
async def post_sync(self, internal_ip):
if self.http_site is None:
self.http_site = await self.middleware.start_tcp_site(internal_ip)


async def setup(middleware):
# on HA systems, we bind ourselves on 127.0.0.1:6000, however
# often times developers/CI/CD do `systemctl restart middlewared`
# which will tear down the local listening socket so we need to
# be sure and set it up everytime middleware starts. This is a
# NO-OP otherwise.
await middleware.call('failover.internal_interface.pre_sync')

0 comments on commit 7687364

Please sign in to comment.