-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Labels
P1needs immediate attentionneeds immediate attention
Description
import atexit
import kaleido
_KALEIDO_INITIALIZED = False
def init_if_not_running():
global _KALEIDO_INITIALIZED
if not _KALEIDO_INITIALIZED:
print("initializing Kaleido")
kaleido.start_sync_server()
_KALEIDO_INITIALIZED = True
def test():
print("I'm being triggered")
def shutdown_kaleido(shutdown_func):
print("shutting down kaleido")
shutdown_func()
atexit.register(shutdown_kaleido, kaleido.stop_sync_server)
atexit.register(test)
init_if_not_running() # comment out to exit gracefully
Then later, when trying to terminate via exit() or quit or Ctrl+D, it will hang. Notably, it will not even print "I'm being triggered" from the other registered function.
But when init_if_not_running() is commented out, it successfully calls the registered functions.
Metadata
Metadata
Assignees
Labels
P1needs immediate attentionneeds immediate attention