summaryrefslogtreecommitdiff
path: root/src/helsinki.at/rhimportd/main.go
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2015-12-21 23:45:49 (GMT)
committerChristian Pointner <equinox@helsinki.at>2015-12-21 23:45:49 (GMT)
commitc0463be82447f269d9947d16a40881dbbe600827 (patch)
tree323dbe19236ee179bea46c9d40af54e2a3403eb3 /src/helsinki.at/rhimportd/main.go
parentb917755aab166ebb59ebdb5356114d373ce5cb91 (diff)
basic session handling works now
Diffstat (limited to 'src/helsinki.at/rhimportd/main.go')
-rw-r--r--src/helsinki.at/rhimportd/main.go31
1 files changed, 14 insertions, 17 deletions
diff --git a/src/helsinki.at/rhimportd/main.go b/src/helsinki.at/rhimportd/main.go
index 4b6ddf4..b90df0a 100644
--- a/src/helsinki.at/rhimportd/main.go
+++ b/src/helsinki.at/rhimportd/main.go
@@ -26,7 +26,6 @@ package main
import (
"flag"
- "fmt"
"log"
"os"
"os/signal"
@@ -53,31 +52,29 @@ func session_test(conf *rhimport.Config, rddb *rhimport.RdDbChan) {
store := sessions.GetInterface()
- ctx := rhimport.NewImportContext(conf, rddb, "hugo")
+ ctx := rhimport.NewImportContext(conf, rddb, "heslinki")
+ ctx.Trusted = true
+ ctx.ShowId = 10002
+ ctx.SourceUri = "fake://10"
+
id, session, err := store.New(ctx)
if err != nil {
- rhl.Printf("Error SessionStore.New(): %s", err)
+ rhl.Printf("MAIN: Error SessionStore.New(): %s", err)
return
}
- fmt.Printf("\n\nSESSION_STORE: %+v\n\n", sessions)
-
+ rhl.Printf("MAIN: calling run for heslinki/%s", id)
session.Run()
- fmt.Printf("\n\nSESSION_STORE: %+v\n\n", sessions)
-
+ rhl.Printf("MAIN: waiting for 2 secondes")
time.Sleep(5 * time.Second)
- store.Remove("hugo", id)
- fmt.Printf("\n\nSESSION_STORE: %+v\n\n", sessions)
-
- time.Sleep(6 * time.Second)
-
- fmt.Printf("\n\nSESSION_STORE: %+v\n\n", sessions)
-
- store.Remove("hugo", id)
+ rhl.Printf("MAIN: calling remove for heslinki/%s", id)
+ if err = store.Remove("heslinki", id); err != nil {
+ rhl.Printf("MAIN: Error SessionStore.Remove(): %s", err)
+ }
- fmt.Printf("\n\nSESSION_STORE: %+v\n\n", sessions)
+ rhl.Printf("MAIN: remove done")
}
func main() {
@@ -108,7 +105,7 @@ func main() {
}
defer rddb.Cleanup()
- // go session_test(conf, rddb.GetInterface())
+ go session_test(conf, rddb.GetInterface())
var wg sync.WaitGroup