Skip to content

Commit

Permalink
async save
Browse files Browse the repository at this point in the history
  • Loading branch information
jnetoatbliss committed Mar 3, 2023
1 parent 84cbd8d commit 0478219
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Sources/manager/Controllers/ApodManagerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ public class ApodManagerController {

private func saveItems(_ items: [NasaApodDto]?) async throws {
let itemsAdd: [ApodStorage] = items?.map { ApodStorage($0) } ?? []
try storageController.saveItemsSql(itemsAdd)
self.items = try getAll()?.mapToEntity()
// for item in itemsAdd {
// try await storageController.asyncSaveItem(item)
// }
// try storageController.saveItemsSql(itemsAdd)
// self.items = try getAll()?.mapToEntity()
for item in itemsAdd {
try await storageController.asyncSaveItem(item)
}
}
}

0 comments on commit 0478219

Please sign in to comment.