MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _deferred_init

Method _deferred_init

shared.py:291–307  ·  view source on GitHub ↗

Run heavy initialization tasks in a background thread. Loads fonts, images, network intelligence, AI service, and network counts without blocking the main startup path.

(self)

Source from the content-addressed store, hash-verified

289
290 self.create_livestatusfile()
291
292 # Defer heavy I/O (fonts, images, AI, network intelligence) to a
293 # background thread so the main thread can continue to start the
294 # display and web server sooner.
295 if not self._pager_mode:
296 threading.Thread(target=self._deferred_init, daemon=True).start()
297 else:
298 # Pager mode: load fonts/images synchronously (lightweight)
299 self.load_fonts()
300 self.load_images()
301 self._deferred_init_done.set()
302
303 # Start background cleanup task for old hosts (needs DB)
304 if not self._pager_mode and self.db is not None:
305 self._start_cleanup_task()
306
307 def _deferred_init(self):
308 """Run heavy initialization tasks in a background thread.
309
310 Loads fonts, images, network intelligence, AI service, and

Callers

nothing calls this directly

Calls 8

load_fontsMethod · 0.95
load_imagesMethod · 0.95
initialize_ai_serviceMethod · 0.95
infoMethod · 0.80
errorMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected