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)
| 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 |
nothing calls this directly
no test coverage detected