Skip to content

Commit

Permalink
- Fix: Update Checker Timeout
Browse files Browse the repository at this point in the history
This commit fixes an issue in the update checker where it would occasionally fail to retrieve updates.

The fix involves setting a timeout of 10 seconds for the retrieval process. If the update data is not received within this timeframe, the process will terminate gracefully and report an empty list. This prevents the app from getting stuck indefinitely while waiting for updates.
  • Loading branch information
jacobrein committed Dec 3, 2024
1 parent 7bbb238 commit be49b42
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,13 @@ class UpdateFlowWorker(
)
)
runCatching {
withTimeoutOrNull(10000) {
m.getRecentFlow()
.catch { emit(emptyList()) }
.firstOrNull()
}
/*withTimeoutOrNull(10000) { m.getRecentFlow().firstOrNull() }*/
getRecents(m)
//getRecents(m)
}
.onFailure {
recordFirebaseException(it)
Expand Down

0 comments on commit be49b42

Please sign in to comment.