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

Improve plugin hook cyclic detection #4625

Merged

Conversation

WithoutPants
Copy link
Collaborator

From Discord:

I can see you have blocked the events being fired if your plugin schedules the scan task to prevent plugins being called again and again recursively but i'm doing it in a way that should not cause problems.

This PR addresses this issue by making the plugin hook cyclic detection a bit smarter. It now records the plugin and hook type data, and allows up to ten of the same hook type before cutting off. Ten is an arbitrary number that should not generally be hit under normal circumstances.

Also moves and renames plugin.HookTriggerEnum to hook.TriggerEnum - in a package underneath plugin.

@WithoutPants WithoutPants added improvement Something needed tweaking. chore Pull requests for refactoring and admin work labels Feb 27, 2024
@WithoutPants WithoutPants added this to the Version 0.25.0 milestone Feb 27, 2024
@WithoutPants WithoutPants merged commit fcf249e into stashapp:develop Feb 27, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Pull requests for refactoring and admin work improvement Something needed tweaking.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant