MCPcopy Index your code
hub / github.com/bugy/script-server / _renew_files_cache

Method _renew_files_cache

src/execution/logging.py:247–273  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

245 return correct_format, parameters_text
246
247 def _renew_files_cache(self):
248 cache = self._ids_to_file_map
249
250 obsolete_ids = []
251 for id, file in cache.items():
252 path = os.path.join(self._output_folder, file)
253 if not os.path.exists(path):
254 obsolete_ids.append(id)
255
256 for obsolete_id in obsolete_ids:
257 LOGGER.info('Logs for execution #' + obsolete_id + ' were deleted')
258 del cache[obsolete_id]
259
260 for file in os.listdir(self._output_folder):
261 if not file.lower().endswith('.log'):
262 continue
263
264 if file in self._visited_files:
265 continue
266
267 self._visited_files.add(file)
268
269 entry = self._extract_history_entry(file)
270 if entry is None:
271 continue
272
273 cache[entry.id] = file
274
275 @staticmethod
276 def _create_log_identifier(audit_name, script_name, start_time):

Callers 4

__init__Method · 0.95
get_history_entriesMethod · 0.95
find_history_entryMethod · 0.95
find_logMethod · 0.95

Calls 2

appendMethod · 0.80

Tested by

no test coverage detected