move some server deps from repo root to lib/

pull/1/head
ansuz 5 years ago
parent c4194117a7
commit f45de2b52f

@ -5,10 +5,10 @@
const nThen = require('nthen');
const Nacl = require('tweetnacl/nacl-fast');
const Crypto = require('crypto');
const Once = require("./lib/once");
const Meta = require("./lib/metadata");
const WriteQueue = require("./lib/write-queue");
const BatchRead = require("./lib/batch-read");
const Once = require("./once");
const Meta = require("./metadata");
const WriteQueue = require("./write-queue");
const BatchRead = require("./batch-read");
let Log;
const now = function () { return (new Date()).getTime(); };

@ -11,25 +11,25 @@ var Fs = require("fs");
var Fse = require("fs-extra");
var Path = require("path");
var Https = require("https");
const Package = require('./package.json');
const Pinned = require('./scripts/pinned');
const Package = require('../package.json');
const Pinned = require('../scripts/pinned');
const Saferphore = require("saferphore");
const nThen = require("nthen");
const getFolderSize = require("get-folder-size");
const Pins = require("./lib/pins");
const Meta = require("./lib/metadata");
const WriteQueue = require("./lib/write-queue");
const BatchRead = require("./lib/batch-read");
const Pins = require("./pins");
const Meta = require("./metadata");
const WriteQueue = require("./write-queue");
const BatchRead = require("./batch-read");
const Util = require("./lib/common-util");
const Util = require("./common-util");
const escapeKeyCharacters = Util.escapeKeyCharacters;
const unescapeKeyCharacters = Util.unescapeKeyCharacters;
const mkEvent = Util.mkEvent;
var RPC = module.exports;
var Store = require("./storage/file");
var BlobStore = require("./storage/blob");
var Store = require("../storage/file");
var BlobStore = require("../storage/blob");
var DEFAULT_LIMIT = 50 * 1024 * 1024;
var SESSION_EXPIRATION_TIME = 60 * 1000;
@ -611,6 +611,9 @@ var updateLimits = function (Env, config, publicKey, cb /*:(?string, ?any[])=>vo
req.end(body);
};
// XXX it's possible for this to respond before the server has had a chance
// to fetch the limits. Maybe we should respond with an error...
// or wait until we actually know the limits before responding
var getLimit = function (Env, publicKey, cb) {
var unescapedKey = unescapeKeyCharacters(publicKey);
var limit = Env.limits[unescapedKey];
@ -1445,6 +1448,7 @@ RPC.create = function (config, cb) {
evPinnedPadsReady: mkEvent(true),
limits: {},
admins: [],
sessionExpirationInterval: undefined,
};
try {

@ -264,7 +264,7 @@ var nt = nThen(function (w) {
}, 1000 * 60 * 5); // run every five minutes
}));
}).nThen(function (w) {
require("./rpc").create(config, w(function (e, _rpc) {
require("./lib/rpc").create(config, w(function (e, _rpc) {
if (e) {
w.abort();
throw e;
@ -272,7 +272,7 @@ var nt = nThen(function (w) {
rpc = _rpc;
}));
}).nThen(function () {
var HK = require('./historyKeeper.js');
var HK = require('./lib/historyKeeper.js');
var hkConfig = {
tasks: config.tasks,
rpc: rpc,

Loading…
Cancel
Save