Skip to content

Commit 875cee5

Browse files
thomhurstclaude
andauthored
fix: Add CancellationToken to Slack.PostWebHookMessage and remove unused IHttpClientFactory (#1547, #1583) (#1691)
- Add CancellationToken parameter to ISlack.PostWebHookMessage interface - Update Slack implementation to accept and check CancellationToken - Remove unused IHttpClientFactory parameter from Http class constructor Fixes #1547, #1583 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e599f2b commit 875cee5

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/ModularPipelines.Slack/ISlack.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ namespace ModularPipelines.Slack;
44

55
public interface ISlack
66
{
7-
Task PostWebHookMessage(SlackWebHookOptions options);
7+
Task PostWebHookMessage(SlackWebHookOptions options, CancellationToken cancellationToken = default);
88
}

src/ModularPipelines.Slack/Slack.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ public Slack(IHttp http)
1313
_http = http;
1414
}
1515

16-
public async Task PostWebHookMessage(SlackWebHookOptions options)
16+
public async Task PostWebHookMessage(SlackWebHookOptions options, CancellationToken cancellationToken = default)
1717
{
18+
cancellationToken.ThrowIfCancellationRequested();
19+
1820
var slackClient = new SlackClient(options.WebHookUri.AbsoluteUri, httpClient: _http.GetLoggingHttpClient());
1921

2022
await slackClient.PostAsync(options.SlackMessage);
2123
}
22-
}
24+
}

src/ModularPipelines/Http/Http.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ internal class Http : IHttp, IDisposable
2020

2121
public Http(HttpClient defaultHttpClient,
2222
IModuleLoggerProvider moduleLoggerProvider,
23-
IHttpClientFactory httpClientFactory,
2423
IHttpLogger httpLogger,
2524
IOptions<PipelineOptions> pipelineOptions)
2625
{

0 commit comments

Comments
 (0)