move max connections from config to db

This commit is contained in:
miloschwartz 2025-06-17 15:53:57 -04:00
parent a0001aaa74
commit 21e9edd201
No known key found for this signature in database
4 changed files with 6 additions and 5 deletions

View file

@ -25,8 +25,8 @@ export const handleNewtPingRequestMessage: MessageHandler = async (context) => {
// higher = more desirable
let weight = 1;
const maxConnections = config.getRawConfig().gerbil.max_connections;
if (maxConnections !== undefined) {
const maxConnections = node.maxConnections;
if (maxConnections !== null && maxConnections !== undefined) {
const [currentConnections] = await db
.select({
count: count()