mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Add: Allow string ttl
If ttl is a string, parse to integer and check validity
This commit is contained in:
parent
3f23212514
commit
69fc06100b
@ -64,7 +64,10 @@ module.exports = function(RED) {
|
||||
node.warn("Expire time too high, using maximum setting of 10800s (3 hours) retry duration");
|
||||
}
|
||||
if (ttl !== null) {
|
||||
if(!Number.isInteger(ttl) || ttl <= 0) {
|
||||
if(typeof ttl === "string") {
|
||||
ttl = parseInt(ttl);
|
||||
}
|
||||
if(isNaN(ttl) || !Number.isInteger(ttl) || ttl <= 0) {
|
||||
ttl = null;
|
||||
node.warn("No valid number for TTL found, not set");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user