feat: Update API versioning and parser handling for improved schedule updates and error management
This commit is contained in:
@@ -28,8 +28,9 @@ struct API: Sendable {
|
||||
|
||||
private static let log = Logger(subsystem: "org.xtimms.psu.schedule", category: "API")
|
||||
private static let offline = "Нет связи с сервером расписания."
|
||||
/// Server codes after which trying again later can help.
|
||||
private static let sourceDown: Set<String> = ["source_unavailable", "source_timeout", "busy"]
|
||||
/// Server codes after which trying again later can help: the university is down or slow, the
|
||||
/// server is busy or did not answer in time, or this address sent too many requests.
|
||||
private static let sourceDown: Set<String> = ["source_unavailable", "source_timeout", "busy", "timeout", "too_many_requests"]
|
||||
private static let retries = 3
|
||||
|
||||
// The server answers "no-cache" with an ETag: URLSession keeps the answer and asks again
|
||||
|
||||
Reference in New Issue
Block a user