summaryrefslogtreecommitdiff
path: root/src/helsinki.at/rhimport
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2015-12-21 07:45:13 (GMT)
committerChristian Pointner <equinox@helsinki.at>2015-12-21 07:45:13 (GMT)
commita71ce473ac19e8ba5cf69f0d1375807529d92b11 (patch)
treef3e79711efc559b4950bec18bc548634661908fb /src/helsinki.at/rhimport
parent75dd88f110c117b7fc73b83b13efd2385347f1b9 (diff)
minor cleanup for session testing
Diffstat (limited to 'src/helsinki.at/rhimport')
-rw-r--r--src/helsinki.at/rhimport/session.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/helsinki.at/rhimport/session.go b/src/helsinki.at/rhimport/session.go
index ce84053..8f20958 100644
--- a/src/helsinki.at/rhimport/session.go
+++ b/src/helsinki.at/rhimport/session.go
@@ -149,7 +149,9 @@ func (self *Session) dispatchRequests() {
for {
select {
case <-self.runChan:
- self.run()
+ if !self.running {
+ self.run()
+ }
case <-self.cancelChan:
if self.running {
rhdl.Println("Session: canceling running imports is not yet implemented")
@@ -168,8 +170,6 @@ func (self *Session) dispatchRequests() {
self.running = false
rhdl.Printf("Session: import is done: %+v", result)
// TODO: call all subscribed done handler
- // TODO: send remove request to session store?
- return
}
}
}
@@ -185,6 +185,7 @@ func (self *Session) getInterface() *SessionChan {
func (self *Session) Cleanup() {
// TODO: this blocks if dispatchRequests has ended already...
+ // or if cancel doesn't work...
self.cancelChan <- true
<-self.done
close(self.done)