With very high limits the calculated TTL may be set to 0. Redis does not support 0 as expiration time for its keys.
Therefore to properly remove those keys from redis again, this sets the value to 1 (in milliseconds) if the given ttl_nano is less than 1 millisecond.
With very high limits the calculated TTL may be set to 0. Redis does not support 0 as expiration time for its keys. Therefore to properly remove those keys from redis again, this sets the value to 1 (in milliseconds) if the given ttl_nano is less than 1 millisecond.