const INCR_SCRIPT: &str = r#"
local n = redis.call('INCRBY', KEYS[1], ARGV[1])
if tonumber(ARGV[2]) > 0 and (tonumber(ARGV[3]) == 1 or redis.call('TTL', KEYS[1]) < 0) then
redis.call('EXPIRE', KEYS[1], ARGV[2])
end
return n
"#;Expand description
INCRBY, then set the expiry only if the key does not already have one.
TTL returns a negative value when the key has no expiry, so the guard also
repairs a key that somehow lost one. One round trip, atomic.
Only ever loaded into a redis::Script on the redis-backed data path (see
StoreIncrPlugin::script), so this is #[cfg(feature = "redis-store")]
like the rest of that path – without the feature there is no consumer.