diff options
author | Bruno Wagner <bwgpro@gmail.com> | 2015-04-23 12:02:32 -0300 |
---|---|---|
committer | Bruno Wagner <bwgpro@gmail.com> | 2015-04-23 12:04:21 -0300 |
commit | d7968a5feb8d556f40f77274da32921e83465d9e (patch) | |
tree | 6fc6a95a00b9a404f97f7944d2c3ab02e67145e9 /service/pixelated/support | |
parent | ed9084b0b9175a272401b231e5d086e64506af15 (diff) |
Patched soledad sync so it will give us meaningful error messages
Diffstat (limited to 'service/pixelated/support')
-rw-r--r-- | service/pixelated/support/ext_sync.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/service/pixelated/support/ext_sync.py b/service/pixelated/support/ext_sync.py new file mode 100644 index 00000000..d35eed3e --- /dev/null +++ b/service/pixelated/support/ext_sync.py @@ -0,0 +1,23 @@ +import leap.soledad.client as client +import logging +import urlparse +from leap.soledad.client.events import ( + SOLEDAD_DONE_DATA_SYNC, + signal +) + + +def patched_sync(self, defer_decryption=True): + if self._db: + try: + local_gen = self._db.sync( + urlparse.urljoin(self.server_url, 'user-%s' % self._uuid), + creds=self._creds, autocreate=False, + defer_decryption=defer_decryption) + signal(SOLEDAD_DONE_DATA_SYNC, self._uuid) + return local_gen + except Exception as e: + client.logger.error("Soledad exception when syncing: %s - %s" % (e.__class__.__name__, e.message)) + + +client.Soledad.sync = patched_sync |