mirror of
https://github.com/Luzifer/tex-api.git
synced 2024-11-09 16:50:03 +00:00
Stop waiting on error
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
7a503be0fa
commit
bcefbe8c79
1 changed files with 12 additions and 4 deletions
12
main.go
12
main.go
|
@ -229,7 +229,11 @@ func waitForJob(res http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if status.Status != statusFinished {
|
switch status.Status {
|
||||||
|
case statusCreated:
|
||||||
|
fallthrough
|
||||||
|
|
||||||
|
case statusStarted:
|
||||||
u := urlMust(router.Get("waitForJob").URL("uid", uid.String()))
|
u := urlMust(router.Get("waitForJob").URL("uid", uid.String()))
|
||||||
u.Query().Set("loop", strconv.Itoa(loop))
|
u.Query().Set("loop", strconv.Itoa(loop))
|
||||||
|
|
||||||
|
@ -237,10 +241,14 @@ func waitForJob(res http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
http.Redirect(res, r, u.String(), http.StatusFound)
|
http.Redirect(res, r, u.String(), http.StatusFound)
|
||||||
return
|
return
|
||||||
}
|
|
||||||
|
|
||||||
|
case statusError:
|
||||||
|
http.Error(res, "Processing ran into an error.", http.StatusInternalServerError)
|
||||||
|
|
||||||
|
case statusFinished:
|
||||||
u := urlMust(router.Get("downloadAssets").URL("uid", uid.String()))
|
u := urlMust(router.Get("downloadAssets").URL("uid", uid.String()))
|
||||||
http.Redirect(res, r, u.String(), http.StatusFound)
|
http.Redirect(res, r, u.String(), http.StatusFound)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func shouldPackFile(extension string) bool {
|
func shouldPackFile(extension string) bool {
|
||||||
|
|
Loading…
Reference in a new issue