mirror of https://github.com/xwiki-labs/cryptpad
move some implictly global state to env.js
This commit is contained in:
parent
12c4451f53
commit
1f1b40b83d
|
@ -2,7 +2,6 @@
|
|||
const Data = module.exports;
|
||||
|
||||
const Meta = require("../metadata");
|
||||
const WriteQueue = require("../write-queue");
|
||||
const Core = require("./core");
|
||||
const Util = require("../common-util");
|
||||
const HK = require("../hk-util");
|
||||
|
@ -53,7 +52,6 @@ Data.getMetadata = function (Env, channel, cb, Server, netfluxId) {
|
|||
value: value
|
||||
}
|
||||
*/
|
||||
var queueMetadata = WriteQueue();
|
||||
Data.setMetadata = function (Env, safeKey, data, cb, Server) {
|
||||
var unsafeKey = Util.unescapeKeyCharacters(safeKey);
|
||||
|
||||
|
@ -63,7 +61,7 @@ Data.setMetadata = function (Env, safeKey, data, cb, Server) {
|
|||
if (!command || typeof (command) !== 'string') { return void cb('INVALID_COMMAND'); }
|
||||
if (Meta.commands.indexOf(command) === -1) { return void cb('UNSUPPORTED_COMMAND'); }
|
||||
|
||||
queueMetadata(channel, function (next) {
|
||||
Env.queueMetadata(channel, function (next) {
|
||||
Data.getMetadataRaw(Env, channel, function (err, metadata) {
|
||||
if (err) {
|
||||
cb(err);
|
||||
|
|
|
@ -45,6 +45,7 @@ module.exports.create = function (config) {
|
|||
queueStorage: WriteQueue(),
|
||||
queueDeletes: WriteQueue(),
|
||||
queueValidation: WriteQueue(),
|
||||
queueMetadata: WriteQueue(),
|
||||
|
||||
batchIndexReads: BatchRead("HK_GET_INDEX"),
|
||||
batchMetadata: BatchRead('GET_METADATA'),
|
||||
|
|
Loading…
Reference in New Issue