aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-07-02 16:51:48 -0500
committermat <github@matdoes.dev>2022-07-02 16:51:48 -0500
commitc951bfb32401ee7e21e256bd391230a1cd4278b7 (patch)
tree6be5b48b7448a91720be261a8d27aff9b6fcb38f
parent4c0649fcf401bf291377a6ab42541b4b567922de (diff)
downloadskyblock-api-c951bfb32401ee7e21e256bd391230a1cd4278b7.tar.gz
skyblock-api-c951bfb32401ee7e21e256bd391230a1cd4278b7.tar.bz2
skyblock-api-c951bfb32401ee7e21e256bd391230a1cd4278b7.zip
bump mongodb version
-rw-r--r--package-lock.json58
-rw-r--r--package.json4
-rw-r--r--src/database.ts4
3 files changed, 34 insertions, 32 deletions
diff --git a/package-lock.json b/package-lock.json
index b05a7bb..fc09f34 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -12,7 +12,7 @@
"express": "^4.18.1",
"express-rate-limit": "^6.4.0",
"lru-cache": "^7.10.1",
- "mongodb": "^4.4.0",
+ "mongodb": "^4.7.0",
"node-cache": "^5.1.2",
"prismarine-nbt": "^2.2.1",
"prom-client": "^14.0.1",
@@ -195,9 +195,9 @@
"integrity": "sha512-XAahCdThVuCFDQLT7R7Pk/vqeObFNL3YqRyFZg+AqAP/W1/w3xHaIxuW7WszQqTbIBOPRcItYJIou3i/mppu3Q=="
},
"node_modules/@types/whatwg-url": {
- "version": "8.2.1",
- "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.1.tgz",
- "integrity": "sha512-2YubE1sjj5ifxievI5Ge1sckb9k/Er66HyR2c+3+I6VDUUg1TLPdYYTEbQ+DjRkS4nTxMJhgWfSfMRD2sl2EYQ==",
+ "version": "8.2.2",
+ "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.2.tgz",
+ "integrity": "sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA==",
"dependencies": {
"@types/node": "*",
"@types/webidl-conversions": "*"
@@ -448,9 +448,9 @@
"dev": true
},
"node_modules/bson": {
- "version": "4.6.2",
- "resolved": "https://registry.npmjs.org/bson/-/bson-4.6.2.tgz",
- "integrity": "sha512-VeJKHShcu1b/ugl0QiujlVuBepab714X9nNyBdA1kfekuDGecxgpTA2Z6nYbagrWFeiIyzSWIOzju3lhj+RNyQ==",
+ "version": "4.6.4",
+ "resolved": "https://registry.npmjs.org/bson/-/bson-4.6.4.tgz",
+ "integrity": "sha512-TdQ3FzguAu5HKPPlr0kYQCyrYUYh8tFM+CMTpxjNzVzxeiJY00Rtuj3LXLHSgiGvmaWlZ8PE+4KyM2thqE38pQ==",
"dependencies": {
"buffer": "^5.6.0"
},
@@ -1359,9 +1359,9 @@
}
},
"node_modules/ip": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz",
- "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo="
+ "version": "1.1.8",
+ "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz",
+ "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg=="
},
"node_modules/ipaddr.js": {
"version": "1.9.1",
@@ -1808,11 +1808,11 @@
"dev": true
},
"node_modules/mongodb": {
- "version": "4.5.0",
- "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.5.0.tgz",
- "integrity": "sha512-A2l8MjEpKojnhbCM0MK3+UOGUSGvTNNSv7AkP1fsT7tkambrkkqN/5F2y+PhzsV0Nbv58u04TETpkaSEdI2zKA==",
+ "version": "4.7.0",
+ "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.7.0.tgz",
+ "integrity": "sha512-HhVar6hsUeMAVlIbwQwWtV36iyjKd9qdhY+s4wcU8K6TOj4Q331iiMy+FoPuxEntDIijTYWivwFJkLv8q/ZgvA==",
"dependencies": {
- "bson": "^4.6.2",
+ "bson": "^4.6.3",
"denque": "^2.0.1",
"mongodb-connection-string-url": "^2.5.2",
"socks": "^2.6.2"
@@ -2530,7 +2530,7 @@
"node_modules/sparse-bitfield": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz",
- "integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=",
+ "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==",
"optional": true,
"dependencies": {
"memory-pager": "^1.0.2"
@@ -3239,9 +3239,9 @@
"integrity": "sha512-XAahCdThVuCFDQLT7R7Pk/vqeObFNL3YqRyFZg+AqAP/W1/w3xHaIxuW7WszQqTbIBOPRcItYJIou3i/mppu3Q=="
},
"@types/whatwg-url": {
- "version": "8.2.1",
- "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.1.tgz",
- "integrity": "sha512-2YubE1sjj5ifxievI5Ge1sckb9k/Er66HyR2c+3+I6VDUUg1TLPdYYTEbQ+DjRkS4nTxMJhgWfSfMRD2sl2EYQ==",
+ "version": "8.2.2",
+ "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-8.2.2.tgz",
+ "integrity": "sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA==",
"requires": {
"@types/node": "*",
"@types/webidl-conversions": "*"
@@ -3431,9 +3431,9 @@
"dev": true
},
"bson": {
- "version": "4.6.2",
- "resolved": "https://registry.npmjs.org/bson/-/bson-4.6.2.tgz",
- "integrity": "sha512-VeJKHShcu1b/ugl0QiujlVuBepab714X9nNyBdA1kfekuDGecxgpTA2Z6nYbagrWFeiIyzSWIOzju3lhj+RNyQ==",
+ "version": "4.6.4",
+ "resolved": "https://registry.npmjs.org/bson/-/bson-4.6.4.tgz",
+ "integrity": "sha512-TdQ3FzguAu5HKPPlr0kYQCyrYUYh8tFM+CMTpxjNzVzxeiJY00Rtuj3LXLHSgiGvmaWlZ8PE+4KyM2thqE38pQ==",
"requires": {
"buffer": "^5.6.0"
}
@@ -4095,9 +4095,9 @@
"dev": true
},
"ip": {
- "version": "1.1.5",
- "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz",
- "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo="
+ "version": "1.1.8",
+ "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz",
+ "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg=="
},
"ipaddr.js": {
"version": "1.9.1",
@@ -4426,11 +4426,11 @@
}
},
"mongodb": {
- "version": "4.5.0",
- "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.5.0.tgz",
- "integrity": "sha512-A2l8MjEpKojnhbCM0MK3+UOGUSGvTNNSv7AkP1fsT7tkambrkkqN/5F2y+PhzsV0Nbv58u04TETpkaSEdI2zKA==",
+ "version": "4.7.0",
+ "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.7.0.tgz",
+ "integrity": "sha512-HhVar6hsUeMAVlIbwQwWtV36iyjKd9qdhY+s4wcU8K6TOj4Q331iiMy+FoPuxEntDIijTYWivwFJkLv8q/ZgvA==",
"requires": {
- "bson": "^4.6.2",
+ "bson": "^4.6.3",
"denque": "^2.0.1",
"mongodb-connection-string-url": "^2.5.2",
"saslprep": "^1.0.3",
@@ -4967,7 +4967,7 @@
"sparse-bitfield": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz",
- "integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=",
+ "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==",
"optional": true,
"requires": {
"memory-pager": "^1.0.2"
diff --git a/package.json b/package.json
index 4d4aad0..5d08932 100644
--- a/package.json
+++ b/package.json
@@ -33,7 +33,7 @@
"express": "^4.18.1",
"express-rate-limit": "^6.4.0",
"lru-cache": "^7.10.1",
- "mongodb": "^4.4.0",
+ "mongodb": "^4.7.0",
"node-cache": "^5.1.2",
"prismarine-nbt": "^2.2.1",
"prom-client": "^14.0.1",
@@ -54,4 +54,4 @@
"typescript": "^4.6.3"
},
"type": "module"
-} \ No newline at end of file
+}
diff --git a/src/database.ts b/src/database.ts
index 66edeff..b4b6043 100644
--- a/src/database.ts
+++ b/src/database.ts
@@ -198,7 +198,9 @@ async function connect(): Promise<void> {
return console.warn('Warning: db_uri was not found in .env. Features that utilize the database such as leaderboards won\'t work.')
if (!process.env.db_name)
return console.warn('Warning: db_name was not found in .env. Features that utilize the database such as leaderboards won\'t work.')
- client = await MongoClient.connect(process.env.db_uri)
+ client = await MongoClient.connect(process.env.db_uri, {
+ maxConnecting: 100
+ })
database = client.db(process.env.db_name)
memberLeaderboardsCollection = database.collection('member-leaderboards')
profileLeaderboardsCollection = database.collection('profile-leaderboards')