Add clean-logs-older-than option
This commit is contained in:
parent
4c7d108e09
commit
880c98ecfb
17 changed files with 360 additions and 10 deletions
11
src/state.rs
11
src/state.rs
|
|
@ -150,7 +150,7 @@ use {
|
|||
ops::{Deref, DerefMut},
|
||||
rc::{Rc, Weak},
|
||||
sync::Arc,
|
||||
time::Duration,
|
||||
time::{Duration, SystemTime},
|
||||
},
|
||||
thiserror::Error,
|
||||
uapi::{OwnedFd, c},
|
||||
|
|
@ -305,6 +305,7 @@ pub struct State {
|
|||
pub egg_state: EggState,
|
||||
pub control_centers: ControlCenters,
|
||||
pub virtual_outputs: VirtualOutputs,
|
||||
pub clean_logs_older_than: Cell<Option<SystemTime>>,
|
||||
}
|
||||
|
||||
// impl Drop for State {
|
||||
|
|
@ -1760,6 +1761,14 @@ impl State {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn perform_clean_logs_older_than(&self) {
|
||||
if let Some(time) = self.clean_logs_older_than.get()
|
||||
&& let Some(logger) = &self.logger
|
||||
{
|
||||
logger.clean_logs_older_than(time);
|
||||
}
|
||||
}
|
||||
|
||||
fn colors_changed(&self) {
|
||||
struct V;
|
||||
impl NodeVisitorBase for V {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue