5 ms·
To avoid race conditions with concurrent requests better to use Redis Lua. See this example: https://gist.github.com/ptarjan/e38f45f2dfe601419ca3af937fff574d ht
by citrin_ru 3y ago
To avoid race conditions with concurrent requests better to use Redis Lua. See this example: https://gist.github.com/ptarjan/e38f45f2dfe601419ca3af937fff574d https://gist.github.com/ptarjan/e38f45f2dfe601419ca3af937fff...
- pquerna 3y agoFor this general pattern implemented in Golang, check out redis_rate: https://github.com/ductone/redis_rate https://github.com/ductone/redis_rate This fork also implements Redis Client Pipelining to check multiple limits at the same time, and Concurrency Limits.