summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-10-03 11:12:40 -0300
committerJesusaves <cpntb1@ymail.com>2022-10-03 11:12:40 -0300
commitac019d8aa9dc090025b06c62c10e27c042b2dd10 (patch)
treed88ff10c044b0ca37ccbeb31a11d001f114c690d
parentbe8e0838244cbee9e0a26627c10b05e28b599460 (diff)
downloadserverdata-ac019d8aa9dc090025b06c62c10e27c042b2dd10.tar.gz
serverdata-ac019d8aa9dc090025b06c62c10e27c042b2dd10.tar.bz2
serverdata-ac019d8aa9dc090025b06c62c10e27c042b2dd10.tar.xz
serverdata-ac019d8aa9dc090025b06c62c10e27c042b2dd10.zip
Fix edge case where an orphan/zombified logmaster would use 100% CPU
-rwxr-xr-xlogmaster.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/logmaster.py b/logmaster.py
index a8afa075e..ebd92ccc4 100755
--- a/logmaster.py
+++ b/logmaster.py
@@ -206,8 +206,6 @@ while running:
sqli.remove(com)
db.commit()
w.close()
- ## No need to flush ALL the time
- time.sleep(SQL_FLUSH)
except KeyboardInterrupt:
running=False
stdout("Shutdown in progress!")
@@ -215,6 +213,10 @@ while running:
except:
traceback.print_exc()
+ ## No need to flush ALL the time
+ if running:
+ time.sleep(SQL_FLUSH)
+
db.close()
stdout("Logmaster finished.")