Skip to content

Commit

Permalink
(minor) rm print time
Browse files Browse the repository at this point in the history
  • Loading branch information
vindarel committed Feb 5, 2020
1 parent 237d81f commit e9726ec
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions search/models/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def history(year=None, month=None, page=None, page_size=PAGE_SIZE):
assert year
assert month
entries = []
beg = pendulum.now()
# beg = pendulum.now()
try:
entries = EntryCopies.objects.order_by("-created").filter(created__year=year).filter(created__month=month)
except Exception as e:
Expand All @@ -355,7 +355,7 @@ def history(year=None, month=None, page=None, page_size=PAGE_SIZE):
TWO_DIGITS_SPEC = '0>2'
YMD = '%Y-%M-%d' # for datetime it is %m
for day in range(1, last_day + 1):
start = pendulum.now()
# start = pendulum.now()
date = "{}-{}-{}".format(year,
format(month, TWO_DIGITS_SPEC),
format(day, TWO_DIGITS_SPEC))
Expand All @@ -376,11 +376,11 @@ def history(year=None, month=None, page=None, page_size=PAGE_SIZE):
'weekday': date_obj.weekday(),
'nb_entered': len(entries_this_day),
'price_entered': price_entered})
end = pendulum.now()
print("------- for day {}: {}".format(day, end - start))
# end = pendulum.now()
# print("------- for day {}: {}".format(day, end - start))

en = pendulum.now()
print("--- entries search took {}".format(beg, en))
# en = pendulum.now()
# print("--- entries search took {}".format(en - beg))

return {'entries': entries,
'nb_entries': nb_entries,
Expand Down

0 comments on commit e9726ec

Please sign in to comment.