Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

Commit 2966302

Browse files
Merge pull request #1347 from bru/patch-1
fix newrelic.coffee
2 parents 43c6ef0 + b15ad07 commit 2966302

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/scripts/newrelic.coffee

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
# Author:
2323
# briandoll
2424

25+
Parser = require("xml2js").Parser
26+
2527
module.exports = (robot) ->
26-
fetchData = (appId) ->
28+
fetchData = (accountId, appId, apiKey, msg) ->
2729
msg.http("https://rpm.newrelic.com/accounts/#{accountId}/applications/#{appId}/threshold_values?api_key=#{apiKey}")
2830
.get() (err, res, body) ->
2931
if err
@@ -41,6 +43,5 @@ module.exports = (robot) ->
4143
accountId = process.env.HUBOT_NEWRELIC_ACCOUNT_ID
4244
appIds = process.env.HUBOT_NEWRELIC_APP_ID.split(',')
4345
apiKey = process.env.HUBOT_NEWRELIC_API_KEY
44-
Parser = require("xml2js").Parser
45-
fetchData(appId) for appId in appIds
46+
fetchData(accountId, appId, apiKey, msg) for appId in appIds
4647

0 commit comments

Comments
 (0)