mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 12:27:07 +00:00
Await on binary data download requests
This commit is contained in:
@@ -582,7 +582,7 @@ export default {
|
||||
}
|
||||
};
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise( async (resolve, reject) => {
|
||||
const cb = (err, res) => {
|
||||
if (res && !err) {
|
||||
const etag = res.headers.get("ETag");
|
||||
@@ -594,7 +594,10 @@ export default {
|
||||
}
|
||||
};
|
||||
|
||||
self.api([url, init, cb, {cache: true}]);
|
||||
// Technically we do not need to await but this is
|
||||
// to slow down the cient and avoid firing too many
|
||||
// requests at once.
|
||||
await self.api([url, init, cb, {cache: true}]);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user