Fix initial load introduced last nigth :(

This commit is contained in:
Bryan Ashby 2018-11-24 09:39:53 -07:00
parent f80e07fcf9
commit 1dafa2854b
1 changed files with 11 additions and 10 deletions

View File

@ -223,28 +223,29 @@ function initialize(cb) {
//
const User = require('./user.js');
const propLoadOpts = {
names : [
UserProps.RealName, UserProps.Sex, UserProps.EmailAddress,
UserProps.Location, UserProps.Affiliations,
],
};
async.waterfall(
[
function getOpUserName(next) {
return User.getUserName(1, next);
},
function getOpProps(opUserName, next) {
const propLoadOpts = {
names : [
UserProps.RealName, UserProps.Sex, UserProps.EmailAddress,
UserProps.Location, UserProps.Affiliations,
],
};
User.loadProperties(User.RootUserID, propLoadOpts, (err, opProps) => {
return next(err, opUserName, opProps, propLoadOpts);
return next(err, opUserName, opProps);
});
}
},
],
(err, opUserName, opProps, propLoadOpts) => {
(err, opUserName, opProps) => {
const StatLog = require('./stat_log.js');
if(err) {
propLoadOpts.concat('username').forEach(v => {
propLoadOpts.names.concat('username').forEach(v => {
StatLog.setNonPeristentSystemStat(`sysop_${v}`, 'N/A');
});
} else {