Skip to content
This repository has been archived by the owner on Sep 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #48 from LuccaSA/AddMachineNameToSlackMessage
Browse files Browse the repository at this point in the history
Add machine name on Slack messages
  • Loading branch information
renardguill committed Mar 2, 2023
2 parents fa43ed5 + a3023a5 commit 69e19b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion TCC.Lib/Notification/SlackSend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ public async Task ReportAsync(OperationSummary op, ISlackOption slackOption, Mod
var msgRoot = new SlackMessage
{
Channel = slackOption.SlackChannel,
Text = $"{shell} *{bucket}* : {mode} {blocksStats} in {op.Stopwatch.Elapsed.HumanizedTimeSpan()}",
Text = bucket == Environment.MachineName ?
$"{shell} *{bucket}* : {mode} {blocksStats} in {op.Stopwatch.Elapsed.HumanizedTimeSpan()}" :
$"{shell} *{bucket}* ({Environment.MachineName.ToLowerInvariant()}) : {mode} {blocksStats} in {op.Stopwatch.Elapsed.HumanizedTimeSpan()}",
};
var response = await _slackClient.SendSlackMessageAsync(msgRoot, slackOption.SlackSecret);

Expand Down

0 comments on commit 69e19b4

Please sign in to comment.