mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-12-15 16:06:17 +00:00
Update PeerJobs.py
This commit is contained in:
@@ -194,18 +194,20 @@ class PeerJobs:
|
|||||||
def cleanJob(self, init = False):
|
def cleanJob(self, init = False):
|
||||||
|
|
||||||
failingJobs = self.JobLogger.getFailingJobs()
|
failingJobs = self.JobLogger.getFailingJobs()
|
||||||
with self.engine.begin() as conn:
|
# with self.engine.begin() as conn:
|
||||||
print(conn.dialect.name)
|
# print(conn.dialect.name)
|
||||||
for job in failingJobs:
|
# for job in failingJobs:
|
||||||
conn.execute(
|
# conn.execute(
|
||||||
self.peerJobTable.update().values(
|
# self.peerJobTable.update().values(
|
||||||
{
|
# {
|
||||||
"ExpireDate": datetime.now()
|
# "ExpireDate": datetime.now()
|
||||||
}
|
# }
|
||||||
).where(self.peerJobTable.columns.JobID == job.get('JobID'))
|
# ).where(self.peerJobTable.columns.JobID == job.get('JobID'))
|
||||||
)
|
# )
|
||||||
self.JobLogger.deleteLogs(JobID=job.get('JobID'))
|
# self.JobLogger.deleteLogs(JobID=job.get('JobID'))
|
||||||
self.JobLogger.log(job.get('JobID'), Message=f"Job is removed due to being stale.")
|
# self.JobLogger.log(job.get('JobID'), Message=f"Job is removed due to being stale.")
|
||||||
|
|
||||||
|
with self.engine.connect() as conn:
|
||||||
if init and conn.dialect.name == 'sqlite':
|
if init and conn.dialect.name == 'sqlite':
|
||||||
print("[WGDashboard] SQLite Vacuuming...")
|
print("[WGDashboard] SQLite Vacuuming...")
|
||||||
self.JobLogger.vacuum()
|
self.JobLogger.vacuum()
|
||||||
|
|||||||
Reference in New Issue
Block a user