-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: allow running a legal hold manually #129
base: main
Are you sure you want to change the base?
Conversation
… execution control
feat: Add reset status endpoint with five-click trigger for legal hold fix: Import Client in legal_hold_row.tsx to resolve ReferenceError
webapp/src/components/legal_hold_table/legal_hold_row/legal_hold_row.tsx
Show resolved
Hide resolved
Co-authored-by: Doug Lauder <[email protected]>
prevent overwriting the loop variable
server/jobs/legal_hold_job.go
Outdated
if lh.IsFinished() { | ||
j.client.Log.Debug(fmt.Sprintf("Legal Hold %s has ended and therefore will not execute.", lh.ID)) | ||
if legalHold.IsFinished() { | ||
j.client.Log.Debug(fmt.Sprintf("Legal Hold %s has ended and therefore does not executing.", legalHold.ID)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor grammar issue.
server/jobs/legal_hold_job.go
Outdated
|
||
if end, err := lhe.Execute(); err != nil { | ||
if updatedLH, err := lhe.Execute(now); err != nil { | ||
if strings.Contains(err.Error(), "another execution is already running") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is another execution is already running
still the error string returned when the mutex cannot be locked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know where this comes from. At first I though this was added by aider somehow but I added this myself and it just couldn't work because the cluster mutex does not return an error if the mutex is already locked, it waits for it to be unlocked.
server/legalhold/legal_hold.go
Outdated
@@ -153,6 +192,11 @@ func (ex *Execution) ExportData() error { | |||
return err | |||
} | |||
|
|||
// Since at this point we have posts, ensure the `HasMessages` is set to true so users can | |||
// download the legal hold. | |||
ex.papi.LogInfo("has_messages = true") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this meant to be an info level log message? I don't think it has enough context to output at that level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, that was a leftover from me trying to figure out why the legal hold was not being updated.
server/jobs/legal_hold_job.go
Outdated
} | ||
|
||
time.Sleep(time.Millisecond * 250) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably a leftover of testing of some sort.
This pull request introduces new functionalities to manage and execute individual legal holds, along with corresponding tests and necessary refactoring. The most important changes include adding new API endpoints, implementing methods to run and reset legal holds, and updating the data model to include status tracking.
New API Endpoints:
server/api.go
.Methods for Legal Hold Management:
runSingleLegalHold
andresetLegalHoldStatus
methods inserver/api.go
to handle the new API endpoints.RunSingleLegalHold
method inserver/jobs/legal_hold_job.go
to execute a specific legal hold.Data Model Updates:
LegalHoldStatus
and added status tracking fields inserver/model/legal_hold.go
Interface and Refactoring:
LegalHoldJobInterface
to standardize the interface for legal hold jobs, facilitating easier testing and future enhancements inserver/jobs/legal_hold_job_interface.go
.Important changes
UI Changes
New button to refresh the legal hold list manually
Added a button to run a legal hold manually
Show when a current legal hold is running
Disable the run button if the legal hold is already running and the download button if there's no messages in the legal hold
Closes #90
Fixes #89