db/ReadOnlyManager.js: completed conversion

Requires temporary hack within `Pad.remove()` to allow for the lack of
callback on the rewritten version.
This commit is contained in:
Ray Bellis 2019-01-30 16:19:51 +00:00
parent bb80325d2c
commit 5192a0c498
2 changed files with 30 additions and 57 deletions

View file

@ -19,6 +19,7 @@ var crypto = require("crypto");
var randomString = require("../utils/randomstring");
var hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
const thenify = require("thenify").withCallback;
const nodeify = require("nodeify");
// serialization/deserialization attributes
var attributeBlackList = ["id"];
@ -621,7 +622,12 @@ Pad.prototype.remove = thenify(function remove(callback) {
// remove the readonly entries
function(callback) {
readOnlyManager.getReadOnlyId(padID, function(err, readonlyID) {
// @TODO - temporary until surrounding code is Promisified
function getReadOnlyId(padID, callback) {
return nodeify(readOnlyManager.getReadOnlyId(padID), callback);
}
getReadOnlyId(padID, function(err, readonlyID) {
if (ERR(err, callback)) return;
db.remove("pad2readonly:" + padID);