dead code removal

This commit is contained in:
Ryan Tharp 2019-11-08 23:30:44 +00:00
parent d767f6c2a1
commit 67be61dc7d
1 changed files with 4 additions and 34 deletions

View File

@ -1,7 +1,6 @@
const fs = require('fs');
const ini = require('loki-launcher/ini');
//let user_access = {}; // this should not live here
let disk_config = {};
let cache, storage;
@ -18,49 +17,20 @@ const updateFromDisk = () => {
updateFromDisk();
const setup = (configObject) => {
({ cache, storage } = configObject);
// start setting things up
//updateUserAccess();
// update every 15 mins
//setInterval(updateUserAccess, 15 * 60 * 1000);
({ cache, storage } = configObject);
// keep disk_config fresh-ish
setInterval(updateFromDisk, 15 * 60 * 1000);
setInterval(updateFromDisk, 15 * 60 * 1000); // every 15 mins
}
/*
const updateUserAccess = () => {
if (!updateFromDisk()) {
return;
}
console.log('config', disk_config);
// reset permissions to purge any deletions
user_access = {};
// load globals pubkeys from file and set their access level
for(const pubKey in disk_config.globals) {
const access = disk_config.globals[pubKey];
// translate pubKey to id of user
cache.getUserID(pubKey, (user, err) => {
//console.log('setting', user.id, 'to', access);
// only if user has registered
if (user) {
user_access[user.id] = access;
}
})
}
// user_access will always be empty here because async
};
*/
// move out
// FIXME: move out
const addTempModerator = async (userid) => {
console.log('Temporarily upgrading', userid, 'to global moderator');
await storage.addServerModerator(userid);
}
// move out
// FIXME: move out
// called by validGlobal
const getUserAccess = async (userid) => {
const globMod = await storage.isGlobalModerator(userid);