More aggressive token strategy to combat bursts

このコミットが含まれているのは:
Zed 2020-06-01 13:54:45 +02:00
コミット 2642e5efe4
1個のファイルの変更2行の追加2行の削除

ファイルの表示

@ -58,5 +58,5 @@ proc poolTokens*(amount: int) {.async.} =
proc initTokenPool*(cfg: Config) {.async.} =
while true:
if tokenPool.countIt(not it.isLimited) < cfg.minTokens:
await poolTokens(min(3, cfg.minTokens - tokenPool.len))
await sleepAsync(4000)
await poolTokens(min(4, cfg.minTokens - tokenPool.len))
await sleepAsync(2000)