summaryrefslogtreecommitdiff
path: root/src/helsinki.at/rhimportd
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2015-12-15 18:47:22 (GMT)
committerChristian Pointner <equinox@helsinki.at>2015-12-15 18:47:22 (GMT)
commitd33cf1f6738a3c3771247dd29e764c296b806f4c (patch)
tree288aed9f17e25a6426b5b8f070239f9b9077a0c8 /src/helsinki.at/rhimportd
parent764c1939b3cf995fd98e4dc27b5709d3b494702b (diff)
improved error handling and overall resilience to different situations
Diffstat (limited to 'src/helsinki.at/rhimportd')
-rw-r--r--src/helsinki.at/rhimportd/ctrlWeb.go2
-rw-r--r--src/helsinki.at/rhimportd/ctrlWebSimple.go3
-rw-r--r--src/helsinki.at/rhimportd/main.go5
3 files changed, 7 insertions, 3 deletions
diff --git a/src/helsinki.at/rhimportd/ctrlWeb.go b/src/helsinki.at/rhimportd/ctrlWeb.go
index 6475a96..0341a95 100644
--- a/src/helsinki.at/rhimportd/ctrlWeb.go
+++ b/src/helsinki.at/rhimportd/ctrlWeb.go
@@ -46,5 +46,5 @@ func StartControlWeb(addr_s string, conf *rhimport.Config, rddb *rhimport.RdDb)
http.Handle("/trusted/simple", webHandler{conf, rddb, true, webSimpleHandler})
rhl.Println("listening on", addr_s)
- http.ListenAndServe(addr_s, nil)
+ http.ListenAndServe(addr_s, nil) // TODO: reader.Timeout, writer.Timeout???
}
diff --git a/src/helsinki.at/rhimportd/ctrlWebSimple.go b/src/helsinki.at/rhimportd/ctrlWebSimple.go
index 41e4f81..2de324f 100644
--- a/src/helsinki.at/rhimportd/ctrlWebSimple.go
+++ b/src/helsinki.at/rhimportd/ctrlWebSimple.go
@@ -40,6 +40,7 @@ type webSimpleRequestData struct {
ClearShowCarts bool `json:"CLEAR_SHOW_CARTS"`
MusicPoolGroup string `json:"MUSIC_POOL_GROUP"`
Cart uint `json:"CART_NUMBER"`
+ ClearCart bool `json:"CLEAR_CART"`
Cut uint `json:"CUT_NUMBER"`
Channels uint `json:"CHANNELS"`
NormalizationLevel int `json:"NORMALIZATION_LEVEL"`
@@ -56,6 +57,7 @@ func newWebSimpleRequestData(conf *rhimport.Config) *webSimpleRequestData {
rd.ClearShowCarts = false
rd.MusicPoolGroup = ""
rd.Cart = 0
+ rd.ClearCart = false
rd.Cut = 0
rd.Channels = conf.ImportParamDefaults.Channels
rd.NormalizationLevel = conf.ImportParamDefaults.NormalizationLevel
@@ -113,6 +115,7 @@ func webSimpleParseRequest(conf *rhimport.Config, rddb *rhimport.RdDb, trusted b
ctx.ClearShowCarts = reqdata.ClearShowCarts
ctx.GroupName = reqdata.MusicPoolGroup
ctx.Cart = reqdata.Cart
+ ctx.ClearCart = reqdata.ClearCart
ctx.Cut = reqdata.Cut
ctx.Channels = reqdata.Channels
ctx.NormalizationLevel = reqdata.NormalizationLevel
diff --git a/src/helsinki.at/rhimportd/main.go b/src/helsinki.at/rhimportd/main.go
index 5184870..1b9e5e0 100644
--- a/src/helsinki.at/rhimportd/main.go
+++ b/src/helsinki.at/rhimportd/main.go
@@ -26,12 +26,13 @@ package main
import (
"flag"
- "helsinki.at/rhimport"
"log"
"os"
"os/signal"
"sync"
- // "io/ioutil"
+
+ "helsinki.at/rhimport"
+ // "io/ioutil"
)
var (