Limit 10 tps for "now all" command

This commit is contained in:
2023-06-14 23:56:39 +09:00
parent 1355d789f6
commit 9503f02f92
3 changed files with 6 additions and 2 deletions

View File

@@ -2,7 +2,7 @@
KissMeBatch 는 command line batch 작업을 위해서 특별하게 구현된 도구입니다.
KISS 의 REST API 가 30 tps 로 제한이 있기 때문에, 동시에 여러 process 에서 batch 작업을 수행하다가, tps 제한에 걸려서 API 호출이 실패하는 것을 막기 위함입니다.
KISS 의 REST API 가 **20 tps** 로 제한이 있기 때문에, 동시에 여러 process 에서 batch 작업을 수행하다가, tps 제한에 걸려서 API 호출이 실패하는 것을 막기 위함입니다.
## Features

View File

@@ -12,6 +12,10 @@ import KissMe
/// Limit to request a candle query
let PreferredCandleTPS: UInt64 = 19
/// Limit to request a current price query
let PreferredNowTPS: UInt64 = 10
/// Limit to request a short query
let PreferredShortsTPS: UInt64 = 5
/// How many seconds does 1 day have?

View File

@@ -33,7 +33,7 @@ extension KissConsole {
let fileUrl = KissConsole.productPriceUrl(productNo: productNo)
try [price].writeCsv(toFile: fileUrl, appendable: true, localized: localized)
try await Task.sleep(nanoseconds: 1_000_000_000 / PreferredCandleTPS)
try await Task.sleep(nanoseconds: 1_000_000_000 / PreferredNowTPS)
} catch {
print(error)
return false