Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IsDaemon.save_state could be more robust #8

Open
untzag opened this issue May 19, 2022 · 0 comments
Open

IsDaemon.save_state could be more robust #8

untzag opened this issue May 19, 2022 · 0 comments

Comments

@untzag
Copy link
Member

untzag commented May 19, 2022

  • save_state triggers only when a setter of state is called (consult the State class and it's updated property). This trigger will not be set if an element of a list in state is altered (e.g. self._state["my_list"][3] = val").
  • save_state could be incorporated in the IsDaemon.close method, to ensure state is saved at shutdown

I would do it in shutdown, not close (because many daemons that have a close do not call super because it is a no-op)

We actually do explicitly save the state in shutdown_all, but that is only used on POSIX systems, not windows...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant