From 99d0353af3168bbf17dbc3ccef59a0710c58135c Mon Sep 17 00:00:00 2001 From: Martin Dimitrov Date: Tue, 29 Oct 2024 20:34:27 -0700 Subject: [PATCH] don't block on discord --- packages/doorman-api/functions/common/discord.private.js | 2 +- packages/doorman-client/functions/buzzer-activated.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/doorman-api/functions/common/discord.private.js b/packages/doorman-api/functions/common/discord.private.js index 6c1887e..1bc0fe1 100644 --- a/packages/doorman-api/functions/common/discord.private.js +++ b/packages/doorman-api/functions/common/discord.private.js @@ -11,7 +11,7 @@ exports.getDiscordClient = async (context) => { const client = new Client({ intents: [GatewayIntentBits.DirectMessages], rest: { - timeout: 4_000, // 4s + timeout: 60_000, // 60s } }); diff --git a/packages/doorman-client/functions/buzzer-activated.js b/packages/doorman-client/functions/buzzer-activated.js index 7170772..7755d48 100644 --- a/packages/doorman-client/functions/buzzer-activated.js +++ b/packages/doorman-client/functions/buzzer-activated.js @@ -90,7 +90,7 @@ exports.handler = async function(context, event, callback) { console.log( invokeId, "UnlockPromise: I was the fastest, so I will attempt to notify discord users before resolving with unlock" ); - await notifyAllDiscord(context, config, `🔓 Doorman buzzed someone up @ Door "${config.door}"`, JSON.stringify(body.fingerprint)); + notifyAllDiscord(context, config, `🔓 Doorman buzzed someone up @ Door "${config.door}"`, JSON.stringify(body.fingerprint)); resolve(twiml); } else { console.log( @@ -113,7 +113,7 @@ exports.handler = async function(context, event, callback) { console.log( invokeId, "GracefulFallbackPromise: I was the fastest, so I will attempt to notify discord users before resolving with a call" ); - await notifyAllDiscord( + notifyAllDiscord( context, config, `📞 Somebody buzzed the door and it dialed through to fallback phone numbers @ Door "${config.door}"`,