This commit is contained in:
parent
fcf8845664
commit
f45746984f
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hibas123/realtimedb",
|
"name": "@hibas123/realtimedb",
|
||||||
"version": "2.0.0-beta.20",
|
"version": "2.0.0-beta.21",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -104,6 +104,8 @@ export class Database {
|
|||||||
return this.#rules;
|
return this.#rules;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public connections = 0;
|
||||||
|
|
||||||
private locks = new DocumentLock();
|
private locks = new DocumentLock();
|
||||||
public collectionLocks = new DocumentLock();
|
public collectionLocks = new DocumentLock();
|
||||||
|
|
||||||
|
@ -151,8 +151,9 @@ export class WebsocketConnectionManager {
|
|||||||
Logging.error(err);
|
Logging.error(err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
db.connections++;
|
||||||
socket.on("close", () => {
|
socket.on("close", () => {
|
||||||
|
db.connections--;
|
||||||
Logging.log(`${session.id} has disconnected!`);
|
Logging.log(`${session.id} has disconnected!`);
|
||||||
session.subscriptions.forEach((unsubscribe) => unsubscribe());
|
session.subscriptions.forEach((unsubscribe) => unsubscribe());
|
||||||
session.subscriptions.clear();
|
session.subscriptions.clear();
|
||||||
|
Reference in New Issue
Block a user