(wq, collection, general, force_delete)
| 41 | |
| 42 | |
| 43 | def sync_collection(wq, collection, general, force_delete): |
| 44 | pair = collection.pair |
| 45 | status_name = get_status_name(pair.name, collection.name) |
| 46 | |
| 47 | try: |
| 48 | cli_logger.info('Syncing {}'.format(status_name)) |
| 49 | |
| 50 | a = storage_instance_from_config(collection.config_a) |
| 51 | b = storage_instance_from_config(collection.config_b) |
| 52 | |
| 53 | sync_failed = False |
| 54 | |
| 55 | def error_callback(e): |
| 56 | nonlocal sync_failed |
| 57 | sync_failed = True |
| 58 | handle_cli_error(status_name, e) |
| 59 | |
| 60 | with manage_sync_status(general['status_path'], pair.name, |
| 61 | collection.name) as status: |
| 62 | sync.sync( |
| 63 | a, b, status, |
| 64 | conflict_resolution=pair.conflict_resolution, |
| 65 | force_delete=force_delete, |
| 66 | error_callback=error_callback, |
| 67 | partial_sync=pair.partial_sync |
| 68 | ) |
| 69 | |
| 70 | if sync_failed: |
| 71 | raise JobFailed() |
| 72 | except JobFailed: |
| 73 | raise |
| 74 | except BaseException: |
| 75 | handle_cli_error(status_name) |
| 76 | raise JobFailed() |
| 77 | |
| 78 | |
| 79 | def discover_collections(wq, pair, **kwargs): |
nothing calls this directly
no test coverage detected