diff options
author | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2008-09-22 11:57:20 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2008-09-22 11:57:20 (GMT) |
commit | a9eb0d9c350dbc4cc0f91aa6e11f2d92c00fa4fa (patch) | |
tree | 1db9db49fae010d786ea9e43e3b90019247722ac | |
parent | 650ab8203ea5ec247ea60740201d2a0e76f346ac (diff) |
Correctly call the completion callback for copies
-rw-r--r-- | src/olpc/datastore/filestore.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/olpc/datastore/filestore.py b/src/olpc/datastore/filestore.py index 77acc49..b1f1dc9 100644 --- a/src/olpc/datastore/filestore.py +++ b/src/olpc/datastore/filestore.py @@ -49,12 +49,15 @@ class FileStore(object): logging.debug('FileStore copying from %r to %r' % \ (file_path, destination_path)) async_copy = AsyncCopy(file_path, destination_path, - lambda: self._async_copy_completion_cb(uid, completion_cb)) + lambda exception: self._async_copy_completion_cb(uid, + completion_cb, + exception)) async_copy.start() - def _async_copy_completion_cb(self, uid, completion_cb): - self._enqueue_checksum(uid) - completion_cb() + def _async_copy_completion_cb(self, uid, completion_cb, exception): + if exception is None: + self._enqueue_checksum(uid) + completion_cb(exception) def _enqueue_checksum(self, uid): queue_path = layoutmanager.get_instance().get_queue_path() |