Make sure we have at least two timestamps in lastmodified calculation
Otherwise our max(*timestamps) call might fail
This commit is contained in:
parent
e76a3ea54f
commit
7c5cc8d256
1 changed files with 1 additions and 1 deletions
|
|
@ -530,7 +530,7 @@ def _files_for_index():
|
|||
|
||||
def _compute_date(files):
|
||||
from datetime import datetime
|
||||
timestamps = map(lambda path: os.stat(path).st_mtime, files)
|
||||
timestamps = map(lambda path: os.stat(path).st_mtime, files) + [0] if files else []
|
||||
max_timestamp = max(*timestamps) if timestamps else None
|
||||
if max_timestamp:
|
||||
# we set the micros to 0 since microseconds are not speced for HTTP
|
||||
|
|
|
|||
Loading…
Reference in a new issue