Skip to content

Commit f852f8d

Browse files
phlogistonjohnmergify[bot]
authored andcommitted
satellite: copy ctx when setting up a server
Copy the ctx object, which drops any cached configuration, so that if-when the server is reloaded fresh new configuration data will be fetched. Signed-off-by: John Mulligan <[email protected]>
1 parent 86283c9 commit f852f8d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sambacc/commands/satellite/keybridge.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import sambacc.config
2727

2828
from ..cli import Context, Fail, commands
29+
from ..common import CommandContext
2930

3031

3132
if typing.TYPE_CHECKING:
@@ -129,14 +130,15 @@ class Restart(Exception):
129130
@commands.command(name="keybridge", arg_func=_serve_args)
130131
def serve_keybridge(ctx: Context) -> None:
131132
"""Start a keybridge varlink RPC server."""
133+
assert isinstance(ctx, CommandContext) # for copy method
132134

133135
def _handler(*args: typing.Any) -> None:
134136
raise Restart()
135137

136138
signal.signal(signal.SIGHUP, _handler)
137139
while True:
138140
try:
139-
_serve(ctx)
141+
_serve(ctx.copy())
140142
return
141143
except KeyboardInterrupt:
142144
_logger.info("Exiting")

0 commit comments

Comments
 (0)