summaryrefslogtreecommitdiff
path: root/src/helsinki.at/rhimportd
diff options
context:
space:
mode:
Diffstat (limited to 'src/helsinki.at/rhimportd')
-rw-r--r--src/helsinki.at/rhimportd/ctrlWebSimple.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/helsinki.at/rhimportd/ctrlWebSimple.go b/src/helsinki.at/rhimportd/ctrlWebSimple.go
index 7b7c70d..1d28818 100644
--- a/src/helsinki.at/rhimportd/ctrlWebSimple.go
+++ b/src/helsinki.at/rhimportd/ctrlWebSimple.go
@@ -67,6 +67,10 @@ func webSimpleResponse(w http.ResponseWriter) {
encoder.Encode(respdata)
}
+func webSimpleProgressCallback(step int, step_name string, progress float64, userdata interface{}) {
+ fmt.Printf("Step %d / %s: %3.2f%%\r", step, step_name, progress * 100)
+}
+
func webSimpleParseRequest(conf *rhimport.Config, rddb *rhimport.RdDb, trusted bool, r *http.Request) (ctx *rhimport.ImportContext, err error) {
decoder := json.NewDecoder(r.Body)
@@ -90,6 +94,7 @@ func webSimpleParseRequest(conf *rhimport.Config, rddb *rhimport.RdDb, trusted b
ctx.AutotrimLevel = reqdata.AutotrimLevel
ctx.UseMetaData = reqdata.UseMetaData
ctx.SourceUri = reqdata.SourceUri
+ ctx.ProgressCallBack = webSimpleProgressCallback
return
}