forked from M-Labs/artiq
gui: fix RPC client teardown
This commit is contained in:
parent
8e24a018ea
commit
a2c074cc33
|
@ -67,14 +67,14 @@ def main():
|
||||||
app = QtGui.QApplication([])
|
app = QtGui.QApplication([])
|
||||||
loop = QEventLoop(app)
|
loop = QEventLoop(app)
|
||||||
asyncio.set_event_loop(loop)
|
asyncio.set_event_loop(loop)
|
||||||
atexit.register(lambda: loop.close())
|
atexit.register(loop.close)
|
||||||
|
|
||||||
rpc_clients = dict()
|
rpc_clients = dict()
|
||||||
for target in "schedule", "repository", "dataset_db":
|
for target in "schedule", "repository", "dataset_db":
|
||||||
client = AsyncioClient()
|
client = AsyncioClient()
|
||||||
loop.run_until_complete(client.connect_rpc(
|
loop.run_until_complete(client.connect_rpc(
|
||||||
args.server, args.port_control, "master_" + target))
|
args.server, args.port_control, "master_" + target))
|
||||||
atexit.register(lambda: client.close_rpc())
|
atexit.register(client.close_rpc)
|
||||||
rpc_clients[target] = client
|
rpc_clients[target] = client
|
||||||
|
|
||||||
smgr = StateManager(args.db_file)
|
smgr = StateManager(args.db_file)
|
||||||
|
|
Loading…
Reference in New Issue