~thisfred/ubuntuone-client/filenames-in-notifications

« back to all changes in this revision

Viewing changes to ubuntuone/syncdaemon/action_queue.py

  • Committer: Tarmac
  • Author(s): Facundo Batista
  • Date: 2011-03-07 16:54:25 UTC
  • mfrom: (905.2.3 unlock-waiting-for-queue)
  • Revision ID: tarmac-20110307165425-xaggmlo198o1vl6n
Unlock the wait_for_queue when cancelled. (LP: #729158)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1313
1313
    def cancel(self):
1314
1314
        """Cancel the command.
1315
1315
 
1316
 
        It also triggers the wait_for_condition deferred (but not the
1317
 
        wait_for_queue one, as if the queue is not active, it's pointless
1318
 
        to release the pathlock for other commands).
 
1316
        Also trigger the wait_for_condition and wait_for_queue deferreds, to
 
1317
        unlock the command and finally release the pathlock.
1319
1318
 
1320
1319
        Do nothing if already cancelled (as cancellation can come from other
1321
1320
        thread, it can come at any time, so we need to support double
1331
1330
        if self.wait_for_conditions is not None:
1332
1331
            self.wait_for_conditions.callback(True)
1333
1332
            self.wait_for_conditions = None
 
1333
        if self.wait_for_queue is not None:
 
1334
            self.wait_for_queue.callback(True)
 
1335
            self.wait_for_queue = None
1334
1336
        self.cleanup()
1335
1337
        self.finish()
1336
1338
        return True