summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/helsinki.at/rhimportd/main.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/helsinki.at/rhimportd/main.go b/src/helsinki.at/rhimportd/main.go
index aeb7194..dee6b37 100644
--- a/src/helsinki.at/rhimportd/main.go
+++ b/src/helsinki.at/rhimportd/main.go
@@ -86,12 +86,21 @@ func session_test(conf *rhimport.Config, rddb *rhimport.RdDbChan) {
ctx.ClearShowCarts = true
ctx.SourceUri = "http://www.tonycuffe.com/mp3/tail%20toddle.mp3"
- id, session, err := store.New(ctx)
+ id, _, err := store.New(ctx)
if err != nil {
rhl.Printf("MAIN: Error SessionStore.New(): %s", err)
return
}
+ var session *rhimport.SessionChan
+ if session, err = store.Get(ctx.UserName, "<test>"); err != nil {
+ rhl.Printf("MAIN: (Expected) Error SessionStore.Get(): %s", err)
+ }
+ if session, err = store.Get(ctx.UserName, id); err != nil {
+ rhl.Printf("MAIN: Error SessionStore.Get(): %s", err)
+ return
+ }
+
pch := make(chan string, 1000)
if err = session.AddProgressHandler((chan<- string)(pch), session_test_progress1); err != nil {
rhl.Printf("MAIN: Error Session.AddProgressHandler(): %s", err)
@@ -101,7 +110,7 @@ func session_test(conf *rhimport.Config, rddb *rhimport.RdDbChan) {
rhl.Printf("MAIN: Error Session.AddDoneHandler(): %s", err)
}
- rhl.Printf("MAIN: calling run for heslinki/%s", id)
+ rhl.Printf("MAIN: calling run for %s/%s", ctx.UserName, id)
session.Run()
time.Sleep(500 * time.Millisecond)
@@ -120,8 +129,8 @@ func session_test(conf *rhimport.Config, rddb *rhimport.RdDbChan) {
}
}
- rhl.Printf("MAIN: calling remove for heslinki/%s", id)
- if err = store.Remove("heslinki", id); err != nil {
+ rhl.Printf("MAIN: calling remove for %s/%s", ctx.UserName, id)
+ if err = store.Remove(ctx.UserName, id); err != nil {
rhl.Printf("MAIN: Error SessionStore.Remove(): %s", err)
}