Limit 10 tps for "now all" command
This commit is contained in:
@@ -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?
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user