Add cleanup() to headless mode docs
henrypinkard opened this issue · 2 comments
henrypinkard commented
Add cleanup() to headless mode docs
ieivanov commented
I've haven't had good experience trying to call cleanup()
independently. I most often run into problems when trying to quit an acquisition with Ctr+C.
The trick is that cleanup()
needs to be called exactly once. It is always called when python exists normally, so the script will hang if you also try to call it once before. But apparently atexit
registered functions are not called if the program does not exit normally, like with Ctr+C. I found this topic but I haven't been able to get it to work yet - I need to close my terminal if I want to quit mid acquisition.
henrypinkard commented
Does this fix solve the problem for you? #674