Add MongoDB query utilities and update batch size for document insertion
This commit is contained in:
+2
-2
@@ -44,12 +44,12 @@ class LPrint:
|
||||
"""Check the log file size and rotate if necessary."""
|
||||
log_size = os.path.getsize(self.logfile)
|
||||
print(f'Logfile Size: {log_size} ({self.humanbytes(log_size)})')
|
||||
if force_rotate or log_size > 10_000_000: # 10 MB
|
||||
if force_rotate or log_size > 50_000_000: # 10 MB
|
||||
self.rotate_logs()
|
||||
|
||||
def rotate_logs(self):
|
||||
"""Rotate the log file."""
|
||||
from logrotater import LogRotate # Assuming logrotater is a custom module
|
||||
from logs.logrotater import LogRotate # Assuming logrotater is a custom module
|
||||
rotater = LogRotate(prefix=self.logfile, verbose=True)
|
||||
try:
|
||||
rotater.rotate()
|
||||
|
||||
Reference in New Issue
Block a user