housekeep: centralize datetime generation

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2022-01-18 05:59:52 -08:00
parent 7bcc8d7ce7
commit 7f6c23d4cb
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
41 changed files with 146 additions and 179 deletions

View file

@ -1,12 +1,10 @@
#!/usr/bin/env python3
from datetime import datetime
from sqlalchemy import and_
import aurweb.config
from aurweb import db
from aurweb import db, time
from aurweb.models import TUVoteInfo
from aurweb.scripts import notify
@ -16,7 +14,7 @@ notify_cmd = aurweb.config.get('notifications', 'notify-cmd')
def main():
db.get_engine()
now = int(datetime.utcnow().timestamp())
now = time.utcnow()
start = aurweb.config.getint("tuvotereminder", "range_start")
filter_from = now + start