-- Concurrency quota dismiss script
-- Removes this request's grant from the sorted set of active grants. Idempotent:
-- ZREM returns 0 if the member is already gone (already dismissed or evicted by
-- expiration in the grant script).
--
-- KEYS[1]: sorted set key
-- ARGV[1]: quotaId
-- Returns: 1 if removed, 0 if not present

redis.call('ZREM', KEYS[1], ARGV[1])
return redis.call('ZCARD', KEYS[1])
