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

Legal hold job is recreated on any server config change #45

Open
mickmister opened this issue May 17, 2024 · 1 comment
Open

Legal hold job is recreated on any server config change #45

mickmister opened this issue May 17, 2024 · 1 comment

Comments

@mickmister
Copy link
Contributor

This plugin makes an assumption that the RPC hook OnConfigurationChange is called only when this plugin's settings have changed, but it's called when any server config value is changed. The plugin creates a new legal hold job when this occurs.

The plugin should instead verify that one of its own plugin settings was changed in the process and then reconfigure itself.


func (p *Plugin) OnConfigurationChange() error {

p.legalHoldJob, err = jobs.NewLegalHoldJob(LegalHoldJobID, p.API, p.Client, p.SQLStore, p.KVStore, p.FileBackend)
if err != nil {
return fmt.Errorf("cannot create legal hold job: %w", err)
}
if err := p.jobManager.AddJob(p.legalHoldJob); err != nil {
return fmt.Errorf("cannot add legal hold job: %w", err)
}
_ = p.jobManager.OnConfigurationChange(p.getConfiguration())

@mickmister
Copy link
Contributor Author

A PR was raised to address this #47, but it may not be the right solution for the core concern here. The focus on this task should be on verifying the behavior of reconfiguring the job on config change, and ensure that it's resilient to being called potentially often.

@mickmister mickmister removed their assignment Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant