new universal plugin configuration object

This commit is contained in:
sparks-alec
2022-12-10 06:53:56 -05:00
parent 93225fc00e
commit 5e21544a81
12 changed files with 204 additions and 118 deletions
+23 -7
View File
@@ -47,17 +47,33 @@ module.exports.init = function init(callback) {
);
if (p.heartbeatTimeout === undefined || p.heartbeatTimeout < 50) {
if(p.heartbeatInterval){
p.heartbeatTimeout = p.heartbeatInterval * 1.5;
//if (p.heartbeatTimeout === undefined || p.heartbeatTimeout < 50) {
if(p.config.heartbeatTimeout){
p.heartbeatTimeout = p.config.heartbeatInterval * 1.5;
}else{
p.heartbeatTimeout = 10000;
}
}
//}
if (p.heartbeatInterval === undefined || p.heartbeatInterval < 50) {
p.heartbeatInterval = 5000;
}
if(p.config.heartbeatInterval){
p.heartbeatInterval = Math.max(50, p.config.heartbeatInterval);
}else{
p.heartbeatInterval = 5000;
}
// p.fields = {};
// if(p.config.fields){
// p.config.fields.forEach(field => {
// p.fields[field.key] = field.value;
// });
// }
// if (p.heartbeatInterval === undefined || p.heartbeatInterval < 50) {
// p.heartbeatInterval = 5000;
// }
}
});