diff options
| author | Tom Forbes <tom@tomforb.es> | 2019-05-27 12:50:05 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-05-29 09:43:10 +0200 |
| commit | 7089502b98f80e8dc1c8f6e85fb0620809aec30e (patch) | |
| tree | e32f72e1e55dee96102e0d25cf6f4c568b831b2a /django | |
| parent | ace0bec804d0bd74e1ecddbe3ea9a8b5b5d0a718 (diff) | |
[2.2.x] Fixed #30523 -- Fixed updating file modification times on seen files in auto-reloader when using StatReloader.
Previously we updated the file mtimes if the file has not been seen
before - i.e on the first iteration of the loop.
If the mtime has been changed we triggered the notify_file_changed()
method which in all cases except the translations will result in the
process being terminated. To be strictly correct we need to update the
mtime for either branch of the conditional.
Regression in 6754bffa2b2df15a741008aa611c1bb0e8dff22b.
Backport of 480492fe70b0bb7df61c00854dc8535c9d21ba64 from master
Diffstat (limited to 'django')
| -rw-r--r-- | django/utils/autoreload.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/utils/autoreload.py b/django/utils/autoreload.py index 35952d5631..c959cd04ca 100644 --- a/django/utils/autoreload.py +++ b/django/utils/autoreload.py @@ -333,9 +333,9 @@ class StatReloader(BaseReloader): while True: for filepath, mtime in self.snapshot_files(): old_time = mtimes.get(filepath) + mtimes[filepath] = mtime if old_time is None: logger.debug('File %s first seen with mtime %s', filepath, mtime) - mtimes[filepath] = mtime continue elif mtime > old_time: logger.debug('File %s previous mtime: %s, current mtime: %s', filepath, old_time, mtime) |
