harvester: Sort plot_paths before splitting it into batches (#11508)

After changing `plot_paths` to be a set in #11204 the plots are loaded 
out of order. Sorting the list before splitting it to batches recovers 
the load order. 

Fixes #11499
This commit is contained in:
dustinface 2022-05-24 22:20:27 +02:00 committed by GitHub
parent b998c69cdf
commit d73fa27ea7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -178,7 +178,7 @@ class PlotManager:
for filename in filenames_to_remove: for filename in filenames_to_remove:
del self.plot_filename_paths[filename] del self.plot_filename_paths[filename]
for remaining, batch in list_to_batches(list(plot_paths), self.refresh_parameter.batch_size): for remaining, batch in list_to_batches(sorted(list(plot_paths)), self.refresh_parameter.batch_size):
batch_result: PlotRefreshResult = self.refresh_batch(batch, plot_directories) batch_result: PlotRefreshResult = self.refresh_batch(batch, plot_directories)
if not self._refreshing_enabled: if not self._refreshing_enabled:
self.log.debug("refresh_plots: Aborted") self.log.debug("refresh_plots: Aborted")