From 746b2e6b2bd3f989319551e7b904f24243cf39c2 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 2 Nov 2024 20:08:57 -0500 Subject: fix bug that would prevent pushbullet failures from being reported --- src/slskd/Integrations/Pushbullet/PushbulletService.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/slskd/Integrations/Pushbullet/PushbulletService.cs b/src/slskd/Integrations/Pushbullet/PushbulletService.cs index 5328f4d6..29033381 100644 --- a/src/slskd/Integrations/Pushbullet/PushbulletService.cs +++ b/src/slskd/Integrations/Pushbullet/PushbulletService.cs @@ -145,9 +145,13 @@ namespace slskd.Integrations.Pushbullet Log.LogDebug("Sending Pushbullet notification {Title} {Body}", title, body); await Retry.Do( - task: () => http.PostAsync(PushUri, content), + task: async () => + { + using var response = await http.PostAsync(PushUri, content); + response.EnsureSuccessStatusCode(); + }, isRetryable: (attempts, ex) => true, - onFailure: (attempts, ex) => Log.LogWarning("Failed attempt {Attempts} to send Pushbullet notification {Title} {Body}: {Message}", attempts, title, body, ex.Message), + onFailure: (attempts, ex) => Log.LogWarning("Failed attempt #{Attempts} to send Pushbullet notification {Title} {Body}: {Message}", attempts, title, body, ex.Message), maxAttempts: PushbulletOptions.RetryAttempts, maxDelayInMilliseconds: 30000); -- cgit v1.2.3