summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--session.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/session.go b/session.go
index ce84053..8f20958 100644
--- a/session.go
+++ b/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)