From 48e620e5167ea279910af131fbd6930fdab03373 Mon Sep 17 00:00:00 2001 From: Jake Bolam Date: Mon, 21 Jan 2019 22:06:08 -0500 Subject: [PATCH] fix: stop spamming messages --- src/utils/getProbot.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/utils/getProbot.js b/src/utils/getProbot.js index 1c69c06b..dad9dd28 100644 --- a/src/utils/getProbot.js +++ b/src/utils/getProbot.js @@ -1,16 +1,12 @@ const { createProbot } = require('probot') const { findPrivateKey } = require('probot/lib/private-key') -let probot - function getProbot() { - probot = - probot || - createProbot({ - id: process.env.APP_ID, - secret: process.env.WEBHOOK_SECRET, - cert: findPrivateKey(), - }) + const probot = createProbot({ + id: process.env.APP_ID, + secret: process.env.WEBHOOK_SECRET, + cert: findPrivateKey(), + }) if (process.env.SENTRY_DSN) { probot.load(require('probot/lib/apps/sentry'))