From 47c624d9eadfb269990342253ebb1fe5bce4817e Mon Sep 17 00:00:00 2001 From: Zhongying Qiao Date: Thu, 5 Nov 2020 16:16:38 -0800 Subject: [PATCH] add additional condition to update expires_at for auth rate limit --- lib/github/kv.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/github/kv.rb b/lib/github/kv.rb index 1a28209..9777a9a 100644 --- a/lib/github/kv.rb +++ b/lib/github/kv.rb @@ -328,7 +328,7 @@ def increment(key, amount: 1, expires: nil, touch_on_insert: false) `expires_at`=IF( concat('',`value`*1) = `value`, IF( - :touch, + :touch OR (`expires_at` IS NULL OR `expires_at`<:now), :expires, `expires_at` ),