From 376e09f3d6a8c8e8436e83ce837097ceee0246c4 Mon Sep 17 00:00:00 2001 From: Brett Heath-Wlaz Date: Fri, 3 May 2024 09:12:45 -0400 Subject: [PATCH] fix slack reminder errors when running locally (#333) --- .../outfront_takeover_tool/alerts/reminders.ex | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/screenplay/outfront_takeover_tool/alerts/reminders.ex b/lib/screenplay/outfront_takeover_tool/alerts/reminders.ex index 88ca6a54..ccea622b 100644 --- a/lib/screenplay/outfront_takeover_tool/alerts/reminders.ex +++ b/lib/screenplay/outfront_takeover_tool/alerts/reminders.ex @@ -17,14 +17,11 @@ defmodule Screenplay.OutfrontTakeoverTool.Alerts.Reminders do end def handle_info(:work, state) do - url = Application.get_env(:screenplay, :slack_webhook_url, "") - schedule_work() - if url == "" do - Logger.info("No Slack Webhook URL found") - else - send_slack_messages_for_outdated_alerts(url) + case Application.get_env(:screenplay, :slack_webhook_url) do + v when v in [nil, ""] -> Logger.info("No Slack Webhook URL found") + url -> send_slack_messages_for_outdated_alerts(url) end {:noreply, state}