chore: log warning when server health check fails

This commit is contained in:
Jonathan Barrow 2026-01-12 12:35:55 -05:00
parent 38c6e6ecdf
commit b805019d28
No known key found for this signature in database
GPG Key ID: 2A7DAA6DED5A77E5

View File

@ -3,6 +3,7 @@ import crypto from 'node:crypto';
import { Schema, model } from 'mongoose';
import uniqueValidator from 'mongoose-unique-validator';
import type { IServer, IServerConnectInfo, IServerMethods, ServerModel } from '@/types/mongoose/server';
import { LOG_WARN } from '@/logger';
// * Kinda ugly to slap this in with the Mongoose stuff but it's fine for now
// TODO - Maybe move this one day?
@ -101,6 +102,7 @@ ServerSchema.method('getServerConnectInfo', async function (): Promise<IServerCo
} catch {
// * Eat error for now, this means that no address responded in time
// TODO - Handle this
LOG_WARN(`Server ${this.service_name} faield to find healthy NEX server. Falling back to random IP`);
}
return {