mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-02-11 14:52:01 +08:00
feat: automatically increase timeout on version upload, closes #1357
This commit is contained in:
parent
a4c49b6549
commit
c529efc53a
@ -148,6 +148,7 @@ const changelogRules = [requiredIf()(() => selectedStep.value === "changelog")];
|
||||
|
||||
const v = useVuelidate();
|
||||
|
||||
const timeout = ref(30_000);
|
||||
async function createPendingVersion() {
|
||||
selectedPlatforms.value.splice(0);
|
||||
|
||||
@ -172,9 +173,16 @@ async function createPendingVersion() {
|
||||
})
|
||||
);
|
||||
|
||||
pendingVersion.value = await useInternalApi<PendingVersion>(`versions/version/${props.project.id}/upload`, "post", formData, { timeout: 45000 }).catch<any>(
|
||||
(e) => handleRequestError(e)
|
||||
);
|
||||
pendingVersion.value = await useInternalApi<PendingVersion>(`versions/version/${props.project.id}/upload`, "post", formData, {
|
||||
timeout: timeout.value,
|
||||
}).catch<any>((e) => {
|
||||
if (e.code === "ECONNABORTED") {
|
||||
notification.error("The request timed out, please try again.");
|
||||
timeout.value = timeout.value * 2;
|
||||
} else {
|
||||
handleRequestError(e);
|
||||
}
|
||||
});
|
||||
loading.create = false;
|
||||
|
||||
if (pendingVersion.value && currentChannel.value) {
|
||||
|
Loading…
Reference in New Issue
Block a user