diff options
Diffstat (limited to 'src/rhimportd/main.go')
-rw-r--r-- | src/rhimportd/main.go | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/rhimportd/main.go b/src/rhimportd/main.go index d941b05..e9608c1 100644 --- a/src/rhimportd/main.go +++ b/src/rhimportd/main.go @@ -28,6 +28,7 @@ import ( "flag" "fmt" "helsinki.at/rhimport" + "helsinki.at/rhrd-go/rddb" "io/ioutil" "log" "os" @@ -88,20 +89,16 @@ func main() { return } - conf, err := rhimport.NewConfig(rdconf.Get().(string), rdxportUrl.Get().(string), tempDir.Get().(string), localFetchDir.Get().(string)) - if err != nil { - rhl.Println("Error reading configuration:", err) - return - } + conf := rhimport.NewConfig(rdxportUrl.Get().(string), tempDir.Get().(string), localFetchDir.Get().(string)) - rddb, err := rhimport.NewRdDb(conf) + db, err := rddb.NewDB(rdconf.Get().(string)) if err != nil { rhl.Println("Error initializing Rivdenll DB:", err) return } - defer rddb.Cleanup() + defer db.Cleanup() - sessions, err := rhimport.NewSessionStore(conf, rddb.GetInterface()) + sessions, err := rhimport.NewSessionStore(conf, db.GetInterface()) if err != nil { rhl.Println("Error initializing Session Store:", err) return @@ -115,7 +112,7 @@ func main() { go func() { defer wg.Done() rhl.Println("starting web-ctrl") - StartControlWeb(webAddr.Get().(string), conf, rddb.GetInterface(), sessions.GetInterface()) + StartControlWeb(webAddr.Get().(string), conf, db.GetInterface(), sessions.GetInterface()) rhl.Println("web-ctrl finished") }() } @@ -125,7 +122,7 @@ func main() { go func() { defer wg.Done() rhl.Println("starting telnet-ctrl") - StartControlTelnet(telnetAddr.Get().(string), conf, rddb.GetInterface(), sessions.GetInterface()) + StartControlTelnet(telnetAddr.Get().(string), conf, db.GetInterface(), sessions.GetInterface()) rhl.Println("telnet-ctrl finished") }() } @@ -135,7 +132,7 @@ func main() { go func() { defer wg.Done() rhl.Println("starting watch-dir-ctrl") - StartWatchDir(watchDir.Get().(string), conf, rddb.GetInterface()) + StartWatchDir(watchDir.Get().(string), conf, db.GetInterface()) rhl.Println("watch-dir-ctrl finished") }() } |