Skip to content

Commit

Permalink
add impl PackType
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuxiujia committed Jul 26, 2024
1 parent 48eb1a7 commit 4a34721
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/plugin/file_split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,21 @@ pub enum PackType {

impl CanPack for PackType {
fn is(&mut self, temp_size: usize, arg: &FastLogRecord) -> bool {
match self {
return match self {
PackType::ByDate(date_time) => {
let dt = fastdate::DateTime::from_system_time(arg.now, fastdate::offset_sec());
if dt.day() > date_time.day() {
*date_time = dt;
return true;
true
} else {
return false;
false
}
}
PackType::BySize(limit) => {
if temp_size >= limit.get_len() {
return true;
true
} else {
return false;
false
}
}
}
Expand Down

0 comments on commit 4a34721

Please sign in to comment.