Skip to content

Commit

Permalink
Add fallback lock when request fails
Browse files Browse the repository at this point in the history
Signed-off-by: Yan Minari <[email protected]>
  • Loading branch information
yangm97 committed Jan 12, 2019
1 parent 8c79fd4 commit 64a0f8c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lua/groupbutler/utilities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ function _M:cache_adminlist(chat_id)
if not ok then
if err.retry_after then
red:setex(global_lock, err.retry_after, "")
else
red:setex(global_lock, 30, "")
end
self:metric_incr("api_getchatadministrators_error_count")
return false, err
Expand Down

0 comments on commit 64a0f8c

Please sign in to comment.