From b1442513a297331db3dffe94c962a543f74f1fae Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Mon, 24 Aug 2020 12:52:03 -0700 Subject: [PATCH] Review comments --- appengine/expiration.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/appengine/expiration.py b/appengine/expiration.py index d095f2756..19142c30a 100644 --- a/appengine/expiration.py +++ b/appengine/expiration.py @@ -25,11 +25,13 @@ import datetime from google.cloud import ndb + +EXPIRATION_DAYS = 365 +# Limit the query to avoid timeouts. +QUERY_LIMIT = 1000 + def delete_expired(): - # Delete entries that have not been accessed in more than a year. - EXPIRATION_DAYS = 365 - # Limit the query to avoid timeouts. - QUERY_LIMIT = 1000 + """Deletes entries that have not been accessed in more than a year.""" bestBefore = datetime.datetime.utcnow() - datetime.timedelta(days=EXPIRATION_DAYS) client = ndb.Client() with client.context():