Skip to content

Commit 4a7df09

Browse files
bgoncalCopilot
andauthored
Add profiling and improve database update in bg (#4231)
<!-- Thank you for submitting a Pull Request and helping to improve Home Assistant. Please complete the following sections to help the processing and review of your changes. Please do not delete anything from this template. --> ## Summary <!-- Provide a brief summary of the changes you have made and most importantly what they aim to achieve --> ## Screenshots <!-- If this is a user-facing change not in the frontend, please include screenshots in light and dark mode. --> ## Link to pull request in Documentation repository <!-- Pull requests that add, change or remove functionality must have a corresponding pull request in the Companion App Documentation repository (https://github.com/home-assistant/companion.home-assistant). Please add the number of this pull request after the "#" --> Documentation: home-assistant/companion.home-assistant# ## Any other notes <!-- If there is any other information of note, like if this Pull Request is part of a bigger change, please include it here. --> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 6b3419e commit 4a7df09

File tree

2 files changed

+163
-107
lines changed

2 files changed

+163
-107
lines changed

Sources/App/WebView/WebViewController.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -750,10 +750,9 @@ final class WebViewController: UIViewController, WKNavigationDelegate, WKUIDeleg
750750
/// Updates the app database and panels for the current server
751751
/// Called after view appears and on pull to refresh to avoid blocking app launch
752752
private func updateDatabaseAndPanels() {
753-
Task {
754-
await Current.appDatabaseUpdater.update(server: server)
755-
Current.panelsUpdater.update()
756-
}
753+
// Update runs in background automatically, returns immediately
754+
Current.appDatabaseUpdater.update(server: server)
755+
Current.panelsUpdater.update()
757756
}
758757

759758
private func showNoActiveURLError() {

0 commit comments

Comments
 (0)