fixed 2 x TODOs, can now add an existing face as a refimg, and I sped up the recent jobs page

This commit is contained in:
2025-08-19 20:53:26 +10:00
parent fa63e08b59
commit 1831c49b15
2 changed files with 3 additions and 10 deletions

4
job.py
View File

@@ -171,7 +171,9 @@ def jobs():
jobs = Job.query.order_by(Job.id.desc()).all()
else:
page_title='Job list (recent)'
jobs = Job.query.filter( Job.last_update >= (func.now() - func.cast(concat(settings.job_archive_age, 'DAYS'), INTERVAL)) ).order_by(Job.id.desc()).all()
# work out cutoff in python (used to do this in sql and it was too slow)
cutoff = datetime.now() - timedelta(days=settings.job_archive_age)
jobs = Job.query.filter( Job.last_update >= cutoff ).order_by(Job.id.desc()).all()
return render_template("jobs.html", jobs=jobs, page_title=page_title)