db/GroupManager: move inner function on top. No functional change
This is to make easier on the eye the next change.pull/3478/head
parent
6af419a88e
commit
c85bcf0614
|
@ -213,7 +213,19 @@ exports.createGroupIfNotExistsFor = function(groupMapper, callback)
|
|||
//try to get a group for this mapper
|
||||
db.get("mapper2group:"+groupMapper, function(err, groupID)
|
||||
{
|
||||
if(ERR(err, callback)) return;
|
||||
function createGroupForMapper(cb) {
|
||||
exports.createGroup(function(err, responseObj)
|
||||
{
|
||||
if(ERR(err, cb)) return;
|
||||
|
||||
//create the mapper entry for this group
|
||||
db.set("mapper2group:"+groupMapper, responseObj.groupID);
|
||||
|
||||
cb(null, responseObj);
|
||||
});
|
||||
}
|
||||
|
||||
if(ERR(err, callback)) return;
|
||||
|
||||
// there is a group for this mapper
|
||||
if(groupID) {
|
||||
|
@ -229,18 +241,6 @@ exports.createGroupIfNotExistsFor = function(groupMapper, callback)
|
|||
else {
|
||||
createGroupForMapper(callback)
|
||||
}
|
||||
|
||||
function createGroupForMapper(cb) {
|
||||
exports.createGroup(function(err, responseObj)
|
||||
{
|
||||
if(ERR(err, cb)) return;
|
||||
|
||||
//create the mapper entry for this group
|
||||
db.set("mapper2group:"+groupMapper, responseObj.groupID);
|
||||
|
||||
cb(null, responseObj);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue