Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Catch server health checker errors #10566

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/server/listenHandler.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {us_listen_socket} from 'uWebSockets.js'
import getGraphQLExecutor from './utils/getGraphQLExecutor'
import {Logger} from './utils/Logger'
import sendToSentry from './utils/sendToSentry'
import serverHealthChecker from './utils/serverHealthChecker'

const listenHandler = (listenSocket: us_listen_socket) => {
Expand All @@ -10,7 +11,7 @@ const listenHandler = (listenSocket: us_listen_socket) => {
Logger.log(`\n🔥🔥🔥 Server ID: ${SERVER_ID}. Ready for Sockets: Port ${PORT} 🔥🔥🔥`)
getGraphQLExecutor().subscribe()
// Cleaning on startup because shutdowns may be abrupt
serverHealthChecker.cleanUserPresence()
serverHealthChecker.cleanUserPresence().catch(sendToSentry)
} else {
Logger.log(`❌❌❌ Port ${PORT} is in use! ❌❌❌`)
}
Expand Down
2 changes: 0 additions & 2 deletions packages/server/utils/serverHealthChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {disconnectQuery} from '../socketHandlers/handleDisconnect'
import {Logger} from './Logger'
import RedisInstance from './RedisInstance'
import publishInternalGQL from './publishInternalGQL'
import sendToSentry from './sendToSentry'

const SERVER_ID = process.env.SERVER_ID!
const INSTANCE_ID = `${SERVER_ID}:${process.pid}`
Expand Down Expand Up @@ -84,7 +83,6 @@ class ServerHealthChecker {
await new Promise((resolve, reject) => {
userPresenceStream.on('end', resolve)
userPresenceStream.on('error', (e) => {
sendToSentry(e)
reject(e)
})
})
Expand Down
Loading