From dcd6e4c772e24602e0b7f1e975c6240b079c4928 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Wed, 18 Sep 2019 15:13:09 +0200 Subject: [PATCH] allow to disable gc in server --- bin/utils.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bin/utils.js b/bin/utils.js index 9b96e16..d52069e 100644 --- a/bin/utils.js +++ b/bin/utils.js @@ -162,15 +162,12 @@ const pingTimeout = 30000 * @param {any} conn * @param {any} req */ -exports.setupWSConnection = (conn, req) => { +exports.setupWSConnection = (conn, req, { docName = req.url.slice(1), gc = true }) => { conn.binaryType = 'arraybuffer' // get doc, create if it does not exist yet - /** - * @type {string} - */ - const docName = req.url.slice(1) const doc = map.setIfUndefined(docs, docName, () => { const doc = new WSSharedDoc(docName) + doc.gc = gc if (persistence !== null) { persistence.bindState(docName, doc) }