Synchronize the given collections or pairs. If no arguments are given, all will be synchronized. This command will not synchronize metadata, use `vdirsyncer metasync` for that. \b \b\bExamples: # Sync everything configured vdirsyncer sync \b # Sync the pai
(ctx, collections, force_delete, max_workers)
| 117 | @pass_context |
| 118 | @catch_errors |
| 119 | def sync(ctx, collections, force_delete, max_workers): |
| 120 | ''' |
| 121 | Synchronize the given collections or pairs. If no arguments are given, all |
| 122 | will be synchronized. |
| 123 | |
| 124 | This command will not synchronize metadata, use `vdirsyncer metasync` for |
| 125 | that. |
| 126 | |
| 127 | \b |
| 128 | \b\bExamples: |
| 129 | # Sync everything configured |
| 130 | vdirsyncer sync |
| 131 | |
| 132 | \b |
| 133 | # Sync the pairs "bob" and "frank" |
| 134 | vdirsyncer sync bob frank |
| 135 | |
| 136 | \b |
| 137 | # Sync only "first_collection" from the pair "bob" |
| 138 | vdirsyncer sync bob/first_collection |
| 139 | ''' |
| 140 | from .tasks import prepare_pair, sync_collection |
| 141 | from .utils import WorkerQueue |
| 142 | |
| 143 | wq = WorkerQueue(max_workers) |
| 144 | |
| 145 | with wq.join(): |
| 146 | for pair_name, collections in collections: |
| 147 | wq.put(functools.partial(prepare_pair, pair_name=pair_name, |
| 148 | collections=collections, |
| 149 | config=ctx.config, |
| 150 | force_delete=force_delete, |
| 151 | callback=sync_collection)) |
| 152 | wq.spawn_worker() |
| 153 | |
| 154 | |
| 155 | @app.command() |
nothing calls this directly
no test coverage detected