mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	[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 in6754bffa2b. Backport of480492fe70from master
This commit is contained in:
		
				
					committed by
					
						 Mariusz Felisiak
						Mariusz Felisiak
					
				
			
			
				
	
			
			
			
						parent
						
							ace0bec804
						
					
				
				
					commit
					7089502b98
				
			| @@ -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) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user