This commit is contained in:
Donald Zou
2025-12-02 13:36:45 +08:00
parent 2de46d97cf
commit a40df0481f
2 changed files with 8 additions and 1 deletions

View File

@@ -92,4 +92,9 @@ class PeerJobLogger:
(self.jobLogTable.c.JobID == JobID if JobID is not None else True),
)
)
)
)
def vacuum(self):
with self.engine.begin() as conn:
if conn.dialect.name == 'sqlite':
conn.execute('VACUUM;')

View File

@@ -205,6 +205,8 @@ class PeerJobs:
self.JobLogger.deleteLogs(JobID=job.get('JobID'))
self.JobLogger.log(job.get('JobID'), Message=f"Job is removed due to being stale.")
if init and conn.dialect.name == 'sqlite':
print("[WGDashboard] SQLite Vacuuming...")
self.JobLogger.vacuum()
conn.execute('VACUUM;')
def __runJob_Compare(self, x: float | datetime, y: float | datetime, operator: str):