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

Fix #7803: Clear sys.modules cache when reloading scripts #7820

Merged
merged 2 commits into from
Nov 12, 2021

Conversation

kkthxbye-code
Copy link
Contributor

Fixes: #7803

The PR clears the sys.modules entry for the script classes we are trying to load, allowing modification and removal of class names without restarting the application server.

I tested all scenarios I could think of and calling scripts from both the web ui and the API. There might be a slight performance penalty, but it should be very minor.

@jeremystretch jeremystretch merged commit 8820cac into netbox-community:develop Nov 12, 2021
@kkthxbye-code kkthxbye-code deleted the script-reload branch November 25, 2021 06:07
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve hot-reloading of custom scripts
2 participants