Remove some cruft and use exitcode to determine failure state
This commit is contained in:
parent
1a5a7ae90c
commit
eadcb5a067
13
main.go
13
main.go
@ -61,13 +61,6 @@ func main() {
|
|||||||
ReadTimeout: 0 * time.Second,
|
ReadTimeout: 0 * time.Second,
|
||||||
}
|
}
|
||||||
|
|
||||||
go func() {
|
|
||||||
for {
|
|
||||||
//fmt.Printf("\n\n%#V\n\n", downloads)
|
|
||||||
time.Sleep(time.Second)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
log.Fatal(srv.ListenAndServe())
|
log.Fatal(srv.ListenAndServe())
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -92,7 +85,6 @@ func HomeHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
BookmarkletURL: template.URL(bookmarkletURL),
|
BookmarkletURL: template.URL(bookmarkletURL),
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("%s", info.BookmarkletURL)
|
|
||||||
err = t.ExecuteTemplate(w, "layout", info)
|
err = t.ExecuteTemplate(w, "layout", info)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
@ -219,7 +211,10 @@ func queue(dl *download) {
|
|||||||
dl.Finished = true
|
dl.Finished = true
|
||||||
dl.ExitCode = cmd.ProcessState.ExitCode()
|
dl.ExitCode = cmd.ProcessState.ExitCode()
|
||||||
|
|
||||||
fmt.Printf("OBJ %#v\n", dl)
|
if dl.ExitCode != 0 {
|
||||||
|
dl.State = "failed"
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func updateDownload(r io.Reader, dl *download) {
|
func updateDownload(r io.Reader, dl *download) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user