Skip to content

Commit

Permalink
Remove the use of Thread.sleep between request, replace with waitPend…
Browse files Browse the repository at this point in the history
…ingUpdate
  • Loading branch information
ppamorim committed Oct 23, 2020
1 parent 96fdfc0 commit 7137a7d
Show file tree
Hide file tree
Showing 7 changed files with 429 additions and 343 deletions.
4 changes: 2 additions & 2 deletions Sources/MeiliSearch/Model/Update.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public struct Update: Codable, Equatable {
///Date when the update has been processed.
public let processedAt: Date?

///Type of `Update`
///Type of `Update`.
public struct UpdateType: Codable, Equatable {

// MARK: Properties
Expand All @@ -43,7 +43,7 @@ public struct Update: Codable, Equatable {
public let name: String

/// ID of update type.
public let number: Int
public let number: Int?

}

Expand Down
5 changes: 3 additions & 2 deletions Sources/MeiliSearch/Updates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ struct Updates {
}

do {
let result: Update.Result = try Constants.customJSONDecoder.decode(Update.Result.self, from: data)

let result: Update.Result = try Constants.customJSONDecoder.decode(
Update.Result.self,
from: data)
completion(.success(result))
} catch {
completion(.failure(error))
Expand Down
Loading

0 comments on commit 7137a7d

Please sign in to comment.