make converter be able to handle multiple requests

Signed-off-by: Ramon Rüttimann <ramon@nine.ch>
master
Ramon Rüttimann 5 years ago
parent 3f5bcffcdd
commit 68620c1e51

@ -30,10 +30,8 @@ func main() {
} }
func conversionHandler() http.HandlerFunc { func conversionHandler() http.HandlerFunc {
conv := converter.New(iTunesDir)
return func(w http.ResponseWriter, r *http.Request) { return func(w http.ResponseWriter, r *http.Request) {
if err := conv.Process(r.Body); err != nil { if err := converter.New(iTunesDir).Process(r.Body); err != nil {
klog.Errorf("could not convert: %v", err) klog.Errorf("could not convert: %v", err)
fmt.Fprintf(w, "could not convert: %v", err) fmt.Fprintf(w, "could not convert: %v", err)
} }

Loading…
Cancel
Save