Merge pull request #479 from TheLastProject/patch-1

Update hibp_last_check on succesful HIBP check
This commit is contained in:
Son Nguyen Kim 2021-05-20 19:07:50 +02:00 committed by GitHub
commit 7a1a1d3a01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -806,6 +806,7 @@ async def _hibp_check(api_key, queue):
) )
return return
alias.hibp_last_check = arrow.utcnow()
db.session.add(alias) db.session.add(alias)
db.session.commit() db.session.commit()
@ -840,7 +841,7 @@ async def check_hibp():
or_(Alias.hibp_last_check.is_(None), Alias.hibp_last_check < max_date) or_(Alias.hibp_last_check.is_(None), Alias.hibp_last_check < max_date)
) )
.filter(Alias.enabled) .filter(Alias.enabled)
.order_by(Alias.id) .order_by(Alias.hibp_last_check.asc())
.all() .all()
): ):
await queue.put(alias.id) await queue.put(alias.id)