From 07e2c41bd6b6986dd35cc215363e88526bf1a788 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Thu, 12 Sep 2024 18:39:25 +0100 Subject: [PATCH] fix: lower minimum ttl to one minute (#70) fixes #66 --- src/index.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 2f76a68..713a39b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,7 +9,9 @@ const log = logger('nat-port-mapper') export interface NatAPIOptions { /** - * Minimum 20 minutes, default 2 hours + * TTL in seconds, minimum one minute + * + * @default 7200 */ ttl?: number description?: string @@ -52,8 +54,8 @@ export class NatAPI { private readonly updateIntervals: Map constructor (opts: NatAPIOptions = {}, client: Client) { - // TTL is 2 hours (min 20 min) - this.ttl = opts.ttl != null ? Math.max(opts.ttl, 1200) : 7200 + // TTL is 2 hours (min 60 secs, default 2 hours) + this.ttl = opts.ttl != null ? Math.max(opts.ttl, 60) : 7200 this.description = opts.description ?? 'NatAPI' this.gateway = opts.gateway this.keepAlive = opts.keepAlive ?? true