From f8d345dc17208f9a718adf8ab1cbf39b60e4a922 Mon Sep 17 00:00:00 2001 From: Matheus Fernandes Date: Fri, 7 Apr 2017 21:52:19 -0700 Subject: [PATCH] Delay the message when ignoring the node version --- scripts/slack.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/slack.js b/scripts/slack.js index 3125635..76dc7c7 100755 --- a/scripts/slack.js +++ b/scripts/slack.js @@ -65,8 +65,13 @@ fetch(`https://api.github.com/repos/${repo}/commits/${commit}`, opts) console.log(`Couldn't send messages/files to Slack`, err); } } else { - const message = `:white_check_mark: Build succeded on Node ${currentNodeVersion} (commit by <${res.authorUrl}|${res.authorName}>)`; - await slackup({ apiKey, channel, type: 'message', message }); + setTimeout( + async () => { + const message = `:white_check_mark: Build succeded on Node ${currentNodeVersion} (commit by <${res.authorUrl}|${res.authorName}>)`; + await slackup({ apiKey, channel, type: 'message', message }); + }, + 3000 + ); } }) .catch(console.error);