]> git.proxmox.com Git - pmg-log-tracker.git/commitdiff
fix logfile counting in months != january
authorStoiko Ivanov <s.ivanov@proxmox.com>
Tue, 1 Feb 2022 09:48:52 +0000 (10:48 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 1 Feb 2022 12:29:26 +0000 (13:29 +0100)
the changes introduced in 1cdbebe57b2ddc255db240d7dbaf2165c482986d

changed the date handling to have current_month and current_year
represent the month and year at time of invocation.
This change was not carried over to the logfile collecting, which set
the current month to january.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Mira Limbeck <m.limbeck@proxmox.com>
src/main.rs

index fb064637fb7dc5e513a3410a129211139459268c..2ba1b99ae5256bbed0954780cbb8baebad7f0f62 100644 (file)
@@ -1802,7 +1802,6 @@ impl Parser {
         } else {
             let filecount = self.count_files_in_time_range();
             for i in (0..filecount).rev() {
-                self.current_month = 0;
                 if let Ok(file) = File::open(LOGFILES[i]) {
                     self.current_file_index = i;
                     if i > 1 {
@@ -1916,7 +1915,6 @@ impl Parser {
         let mut buffer = Vec::new();
 
         for (i, item) in LOGFILES.iter().enumerate() {
-            self.current_month = 0;
 
             count = i;
             if let Ok(file) = File::open(item) {