|
|
|
@ -45,11 +45,11 @@ class SourceFileManager { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func fetchData() async { |
|
|
|
func fetchData() async { |
|
|
|
if let mostRecent = mostRecentDateAvailable, let current = Calendar.current.date(byAdding: .month, value: 1, to: mostRecent), current > mostRecent { |
|
|
|
|
|
|
|
await fetchData(fromDate: current) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
await fetchData(fromDate: Date()) |
|
|
|
await fetchData(fromDate: Date()) |
|
|
|
} |
|
|
|
// if let mostRecent = mostRecentDateAvailable, let current = Calendar.current.date(byAdding: .month, value: 1, to: mostRecent), current > mostRecent { |
|
|
|
|
|
|
|
// await fetchData(fromDate: current) |
|
|
|
|
|
|
|
// } else { |
|
|
|
|
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func _removeAllData(fromDate current: Date) { |
|
|
|
func _removeAllData(fromDate current: Date) { |
|
|
|
@ -96,11 +96,11 @@ class SourceFileManager { |
|
|
|
try await group.waitForAll() |
|
|
|
try await group.waitForAll() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if current < Date() { |
|
|
|
// if current < Date() { |
|
|
|
if let nextCurrent = Calendar.current.date(byAdding: .month, value: 1, to: current) { |
|
|
|
// if let nextCurrent = Calendar.current.date(byAdding: .month, value: 1, to: current) { |
|
|
|
await fetchData(fromDate: nextCurrent) |
|
|
|
// await fetchData(fromDate: nextCurrent) |
|
|
|
} |
|
|
|
// } |
|
|
|
} |
|
|
|
// } |
|
|
|
} catch { |
|
|
|
} catch { |
|
|
|
print("downloadRankingData", error) |
|
|
|
print("downloadRankingData", error) |
|
|
|
|
|
|
|
|
|
|
|
|