From 97bd79b32f0c402bb99210f7cb8b2ec1b7124e6d Mon Sep 17 00:00:00 2001 From: Alex Nobert Date: Mon, 1 Jul 2019 15:38:52 +0200 Subject: [PATCH] Fix duplicated on-call schedules when there are multiple results --- src/scripts/pagerduty.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scripts/pagerduty.coffee b/src/scripts/pagerduty.coffee index e8228ef9..7cb57ed5 100644 --- a/src/scripts/pagerduty.coffee +++ b/src/scripts/pagerduty.coffee @@ -629,10 +629,10 @@ module.exports = (robot) -> cb null if scheduleName? - withScheduleMatching msg, scheduleName, (s) -> - renderSchedule s, (err) -> + SchedulesMatching msg, scheduleName, (s) -> + async.map s, renderSchedule, (err) -> if err? - robot.emit 'error' + robot.emit 'error', err, msg return msg.send messages.join("\n") else