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

@@ -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