                 
                 if response["failed"].intValue > 0 {
                     self.onKeyExpired()
-                    self.canFinish = true
+                    self.semaphore.signal()
                 }
                 else {
                     let newTs = response["ts"].stringValue

    
    override func main() {
        update(ts: startTs)
    }
    
    private func update(ts: String) {

    override func cancel() {
        super.cancel()
        currentRequest?.cancel()
        semaphore.signal()
    }
}
