mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Check for value error caused by no valid files found with files_changed
This causes an infinite loop when in auto-reload Fix #467 Fix #451 Fix #443
This commit is contained in:
parent
8ecebc9310
commit
86da6d1f2e
2 changed files with 22 additions and 5 deletions
|
|
@ -241,10 +241,14 @@ def files_changed(path, extensions):
|
|||
yield os.stat(os.path.join(root, f)).st_mtime
|
||||
|
||||
global LAST_MTIME
|
||||
mtime = max(file_times(path))
|
||||
if mtime > LAST_MTIME:
|
||||
LAST_MTIME = mtime
|
||||
return True
|
||||
try:
|
||||
mtime = max(file_times(path))
|
||||
if mtime > LAST_MTIME:
|
||||
LAST_MTIME = mtime
|
||||
return True
|
||||
except ValueError:
|
||||
logger.info("No files found in path")
|
||||
return False
|
||||
return False
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue