mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 15:15:38 -05:00
New jobs dao method to get jobs that are older than a certain number of days.
Used in deleting CSV files scheduled task
This commit is contained in:
@@ -66,3 +66,9 @@ def dao_create_job(job):
|
||||
def dao_update_job(job):
|
||||
db.session.add(job)
|
||||
db.session.commit()
|
||||
|
||||
|
||||
def dao_get_jobs_older_than(limit_days):
|
||||
return Job.query.filter(
|
||||
cast(Job.created_at, sql_date) < days_ago(limit_days)
|
||||
).order_by(desc(Job.created_at)).all()
|
||||
|
||||
Reference in New Issue
Block a user