fix(ui): auto-reconnect worker connection with retry backoff
Add IndefiniteRetryPolicy for WithAutomaticReconnect, wrap initial
StartAsync in a retry loop so the UI keeps retrying when Worker is
offline at startup, and expose IsReconnecting to StatusBar
("Connecting..." / "Online" / "Offline").
This commit is contained in:
@@ -18,9 +18,12 @@ public partial class StatusBarViewModel : ViewModelBase
|
||||
|
||||
worker.PropertyChanged += (_, e) =>
|
||||
{
|
||||
if (e.PropertyName == nameof(WorkerClient.IsConnected))
|
||||
if (e.PropertyName == nameof(WorkerClient.IsConnected) ||
|
||||
e.PropertyName == nameof(WorkerClient.IsReconnecting))
|
||||
{
|
||||
ConnectionStatus = worker.IsConnected ? "Online" : "Offline";
|
||||
ConnectionStatus = worker.IsConnected ? "Online"
|
||||
: worker.IsReconnecting ? "Connecting..."
|
||||
: "Offline";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user