pub struct ReviewRunStore { /* private fields */ }Implementations§
Source§impl ReviewRunStore
impl ReviewRunStore
pub fn new(root: impl Into<PathBuf>) -> Self
pub fn runs_dir(&self) -> PathBuf
pub fn path(&self, id: &str) -> PathBuf
pub fn create_queued( &self, commit_sha: &str, target: impl Into<String>, ) -> Result<ReviewRun, ReviewerError>
pub fn read(&self, id: &str) -> Result<ReviewRun, ReviewerError>
pub fn list(&self) -> Result<Vec<ReviewRun>, ReviewerError>
pub fn status_counts(&self) -> Result<ReviewRunStatusCounts, ReviewerError>
pub fn latest_result(&self) -> Result<ReviewRun, ReviewerError>
pub fn mark_running( &self, id: &str, phase: &str, ) -> Result<ReviewRun, ReviewerError>
pub fn mark_completed( &self, id: &str, ledger_entries: usize, ) -> Result<ReviewRun, ReviewerError>
pub fn mark_failed( &self, id: &str, error: impl Into<String>, ) -> Result<ReviewRun, ReviewerError>
pub fn cancel_queued(&self, id: &str) -> Result<ReviewRun, ReviewerError>
Sourcepub fn read_reconciled(&self, id: &str) -> Result<ReviewRun, ReviewerError>
pub fn read_reconciled(&self, id: &str) -> Result<ReviewRun, ReviewerError>
Read a run and, if it is a Running zombie (recorded worker pid is dead),
flip it to Failed and persist the change so review status reports the
truth instead of a run stuck running forever.
Sourcepub fn list_reconciled(&self) -> Result<Vec<ReviewRun>, ReviewerError>
pub fn list_reconciled(&self) -> Result<Vec<ReviewRun>, ReviewerError>
List all runs, reconciling any Running zombies to Failed and persisting
the correction, so a dead worker never lingers as running.
Sourcepub fn cancel(&self, id: &str, force: bool) -> Result<ReviewRun, ReviewerError>
pub fn cancel(&self, id: &str, force: bool) -> Result<ReviewRun, ReviewerError>
Cancel a review run, tolerating a running-but-dead worker.
Queuedruns cancel outright.- A
Runningrun whose worker pid is dead is reaped (markedFailedstale), so a zombie can always be cleaned up. - A
Runningrun with a live worker is refused unlessforce, which SIGKILLs the worker and then marks the runCancelled. - A
Runninglegacy run with no recorded pid can only be reaped withforce. - Terminal runs (completed/failed/cancelled) are refused.
Trait Implementations§
Source§impl Clone for ReviewRunStore
impl Clone for ReviewRunStore
Source§fn clone(&self) -> ReviewRunStore
fn clone(&self) -> ReviewRunStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ReviewRunStore
impl RefUnwindSafe for ReviewRunStore
impl Send for ReviewRunStore
impl Sync for ReviewRunStore
impl Unpin for ReviewRunStore
impl UnsafeUnpin for ReviewRunStore
impl UnwindSafe for ReviewRunStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more