зеркало из https://github.com/mozilla/glean.git
Avoid multiple ping uploads in flight by launching the next step after upload is done
This commit is contained in:
Родитель
31aec35ae5
Коммит
d1f4821d0a
|
@ -159,7 +159,16 @@ public class HttpPingUploader {
|
||||||
body.append(contentsOf: request.body)
|
body.append(contentsOf: request.body)
|
||||||
self.upload(path: request.path, data: body, headers: request.headers) { result in
|
self.upload(path: request.path, data: body, headers: request.headers) { result in
|
||||||
gleanProcessPingUploadResponse(request.documentId, result)
|
gleanProcessPingUploadResponse(request.documentId, result)
|
||||||
|
|
||||||
|
// launch a new iteration.
|
||||||
|
Dispatchers.shared.launchAsync {
|
||||||
|
HttpPingUploader(configuration: self.config, testingMode: self.testingMode).process()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// we don't want to launch multiple uploads at once.
|
||||||
|
// if the upload finishes, we going to launch the next one.
|
||||||
|
return
|
||||||
case .wait(let time):
|
case .wait(let time):
|
||||||
sleep(UInt32(time) / 1000)
|
sleep(UInt32(time) / 1000)
|
||||||
continue
|
continue
|
||||||
|
|
Загрузка…
Ссылка в новой задаче