Skip to content

Commit

Permalink
VACMS-19369: Adds messaging to Slack, following established pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
omahane committed Dec 10, 2024
1 parent 8a3434f commit 34a9618
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ public function onQueueItemProcessed(QueueItemProcessedEvent $event) {
// The response might have been 200 from the TIC not the Facility API.
$message = sprintf('Item %s Posted with a 200, but had an unexpected response with a size: %F phrase: %s', $item_data['uid'], $size, $response_phrase);
$this->logger->get('va_gov_post_api')->warning($message);

if ($this->moduleHandler->moduleExists('slack')) {
$slack_config = $this->config->get('slack.settings');
if ($slack_config->get('slack_webhook_url')) {
$this->slack->sendMessage(':warning: ' . $message);
}
}

// Add the item that might not have been processed back to the queue.
$this->postQueue->addToQueue($item_data);
}
Expand Down

0 comments on commit 34a9618

Please sign in to comment.