Skip to content

Commit cc552ce

Browse files
Best2Twoaudiodude
authored andcommitted
fix-time-calc-and-redundant-save
1 parent 5f11b2e commit cc552ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

wp1/logs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ def calculate_logs_to_update(redis, project_name, from_dt=None):
8787
those that are newer than that date. Otherwise, the date of the most recently
8888
uploaded log, as determined by querying the wiki replica, is used.
8989
"""
90-
from_dt = get_current_datetime() - timedelta(days=7)
91-
from_dt.replace(hour=23, minute=59, second=59)
90+
if from_dt is None:
91+
from_dt = get_current_datetime() - timedelta(days=7)
92+
from_dt = from_dt.replace(hour=23, minute=59, second=59)
9293

9394
dt_to_log = defaultdict(list)
9495
for log in logic_log.get_logs(redis, project=project_name, start_dt=from_dt):
@@ -244,4 +245,3 @@ def update_log_page_for_project(project_name):
244245
wikidb.close()
245246
if wp10db:
246247
wp10db.close()
247-
api.save_page(p, update, "Update logs for past 7 days")

0 commit comments

Comments
 (0)