Add MongoDB query utilities and update batch size for document insertion

This commit is contained in:
2026-02-06 14:49:56 -05:00
parent 1283bd282a
commit 8ed2a77365
5 changed files with 406 additions and 4 deletions
+2 -2
View File
@@ -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()