diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index c9f8856b4..ca706e325 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -37,8 +37,8 @@ const hooks = require('../../static/js/pluginfw/hooks.js'); const channels = require('channels'); const stats = require('../stats'); const assert = require('assert').strict; -const nodeify = require('nodeify'); const {RateLimiterMemory} = require('rate-limiter-flexible'); +const util = require('util'); const webaccess = require('../hooks/express/webaccess'); let rateLimiter; @@ -87,9 +87,8 @@ stats.gauge('activePads', () => { /** * A changeset queue per pad that is processed by handleUserChanges() */ -const padChannels = new channels.channels( - ({socket, message}, callback) => nodeify(handleUserChanges(socket, message), callback) -); +const padChannels = + new channels.channels(({socket, message}, cb) => handleUserChangesCb(socket, message, cb)); /** * This Method is called by server.js to tell the message handler on which socket it should send @@ -691,6 +690,7 @@ const handleUserChanges = async (socket, message) => { stopWatch.end(); }; +const handleUserChangesCb = util.callbackify(handleUserChanges); exports.updatePadClients = async (pad) => { // skip this if no-one is on this pad diff --git a/src/package-lock.json b/src/package-lock.json index 5f602c433..3565f4b40 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -3054,7 +3054,8 @@ "is-promise": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-1.0.1.tgz", - "integrity": "sha1-MVc3YcBX4zwukaq56W2gjO++duU=" + "integrity": "sha1-MVc3YcBX4zwukaq56W2gjO++duU=", + "dev": true }, "is-redirect": { "version": "1.0.0", @@ -4012,6 +4013,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/nodeify/-/nodeify-1.0.1.tgz", "integrity": "sha1-ZKtpp7268DzhB7TwM1yHwLnpGx0=", + "dev": true, "requires": { "is-promise": "~1.0.0", "promise": "~1.3.0" @@ -7509,6 +7511,7 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/promise/-/promise-1.3.0.tgz", "integrity": "sha1-5cyaTIJ45GZP/twBx9qEhCsEAXU=", + "dev": true, "requires": { "is-promise": "~1" } diff --git a/src/package.json b/src/package.json index f09968be5..3dba9c9db 100644 --- a/src/package.json +++ b/src/package.json @@ -53,7 +53,6 @@ "log4js": "0.6.38", "measured-core": "^2.0.0", "mime-types": "^2.1.33", - "nodeify": "1.0.1", "npm": "^6.14.15", "openapi-backend": "^4.2.0", "proxy-addr": "^2.0.7", @@ -90,6 +89,7 @@ "etherpad-cli-client": "^0.1.12", "mocha": "^9.1.1", "mocha-froth": "^0.2.10", + "nodeify": "^1.0.1", "openapi-schema-validation": "^0.4.2", "selenium-webdriver": "^4.0.0-rc-1", "set-cookie-parser": "^2.4.8",