diff options
author | Christian Pointner <equinox@helsinki.at> | 2015-12-21 07:45:13 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2015-12-21 07:45:13 (GMT) |
commit | 7ba1348b1a9cbfc53f902ea43282d6207fc40313 (patch) | |
tree | 2246323d0788c896f1b4f1fe6e16f5fc4d7607a4 | |
parent | 795d37b3aa2ee04f9a56a9a75284b0a4ac8a4b0f (diff) |
minor cleanup for session testing
-rw-r--r-- | session.go | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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) |