Fix bug on "candle day all resume"
This commit is contained in:
@@ -27,7 +27,9 @@ class KissConsole: KissMe.ShopContext {
|
||||
|
||||
var indexContext: IndexContext
|
||||
|
||||
|
||||
let maxCandleDay: Int = 250
|
||||
|
||||
|
||||
private enum KissCommand: String {
|
||||
case quit = "quit"
|
||||
|
||||
@@ -678,7 +680,7 @@ extension KissConsole {
|
||||
|
||||
let semaphore = DispatchSemaphore(value: 0)
|
||||
Task {
|
||||
let success = await getCandle(productNo: productNo, period: .daily, count: 250, startDate: nil)
|
||||
let success = await getCandle(productNo: productNo, period: .daily, count: maxCandleDay, startDate: nil)
|
||||
print("DONE \(success) \(productNo)")
|
||||
semaphore.signal()
|
||||
}
|
||||
@@ -700,7 +702,17 @@ extension KissConsole {
|
||||
return
|
||||
}
|
||||
|
||||
let success = await getCandle(productNo: item.shortCode, period: .daily, count: 250, startDate: startDate)
|
||||
let count: Int
|
||||
if let startDate = startDate {
|
||||
let daysBefore = ceil(startDate.distance(to: Date()) / SecondsForOneDay)
|
||||
count = Int(daysBefore)
|
||||
}
|
||||
else {
|
||||
count = maxCandleDay
|
||||
}
|
||||
|
||||
|
||||
let success = await getCandle(productNo: item.shortCode, period: .daily, count: count, startDate: startDate)
|
||||
print("DONE \(success) \(item.shortCode)")
|
||||
semaphore.signal()
|
||||
#if DEBUG
|
||||
|
||||
2
bin/data
2
bin/data
Submodule bin/data updated: 2c0d7bf82e...ae22bb858d
Reference in New Issue
Block a user