Skip to content

Commit

Permalink
Update syncfile.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
donnie4w committed Dec 29, 2024
1 parent 08b2ebc commit a516577
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/syncfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ impl FileHandler {
match self.cutmode {
CUTMODE::TIME => rename(&log_path, self.compress, self.max_backups, Some(getbackup_with_time(self.startsec, self.timemode))),
CUTMODE::SIZE => rename(&log_path, self.compress, self.max_backups, None),
CUTMODE::MIXED=>rename(&log_path, self.compress, self.max_backups, Some(getbackup_with_time(self.startsec, self.timemode))),
}
}

Expand All @@ -117,6 +118,14 @@ impl FileHandler {
}
}
}
CUTMODE::MIXED=> {
if passtimemode(self.startsec, self.timemode)|| self.max_size > 0 && self.filesize + data.len() as u64 > self.max_size{
if let Ok(_) = self.rename() {
let _ = self.new_from_clone();
self.startsec = timesec();
}
}
}
}
self.filehandle.write(data)?;
self.filesize += data.len() as u64;
Expand Down

0 comments on commit a516577

Please sign in to comment.