Browse Source

fix check

tsi 2 years ago
parent
commit
a345b40afc
1 changed files with 2 additions and 2 deletions
  1. 2 2
      scripts/check_serial.py

+ 2 - 2
scripts/check_serial.py

@@ -25,7 +25,7 @@ def check_log_file(log_file, error_msg, last_line_file):
     last_line_read = 0
     last_line_read = 0
     if os.path.exists(last_line_file):
     if os.path.exists(last_line_file):
         with open(last_line_file, "r") as f:
         with open(last_line_file, "r") as f:
-            last_line_read = int(f.readline().strip())
+            last_line_read = int(f.readline().strip()) 
     
     
     with open(log_file, "r") as f:
     with open(log_file, "r") as f:
         log_lines = f.readlines()
         log_lines = f.readlines()
@@ -37,7 +37,7 @@ def check_log_file(log_file, error_msg, last_line_file):
     for i, line in enumerate(log_lines[last_line_read:]):
     for i, line in enumerate(log_lines[last_line_read:]):
         if re.search(error_msg, line):
         if re.search(error_msg, line):
             with open(last_line_file, "w") as f:
             with open(last_line_file, "w") as f:
-                f.write(str(last_line_read + i))
+                f.write(str(last_line_read + i + 1))
             return True
             return True
     with open(last_line_file, "w") as f:
     with open(last_line_file, "w") as f:
         f.write(str(len(log_lines)))
         f.write(str(len(log_lines)))