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

Add lifetime_function to ServiceSettingsBase #119

Merged
merged 7 commits into from
Oct 3, 2023

Conversation

chrisburr
Copy link
Member

Needs #118. Only the last commit is relavent.

This commit adds an async context manager method lifetime_function to the ServiceSettingsBase class, enabling the execution of specific code at startup and shutdown. The lifetime_function is also appended to app.lifetime_functions in the routers/__init__.py file to be tracked and executed by the application, in similar way to how the databases track state for the lifetime of the application.

@chrisburr chrisburr requested a review from chaen October 2, 2023 15:45
@chrisburr chrisburr mentioned this pull request Oct 2, 2023
@chrisburr chrisburr marked this pull request as ready for review October 3, 2023 07:51
@chaen chaen merged commit 4c5744b into DIRACGrid:main Oct 3, 2023
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

Successfully merging this pull request may close these issues.

2 participants