Synchronize metadata of the given collections or pairs. See the `sync` command for usage.
(ctx, collections, max_workers)
| 158 | @pass_context |
| 159 | @catch_errors |
| 160 | def metasync(ctx, collections, max_workers): |
| 161 | ''' |
| 162 | Synchronize metadata of the given collections or pairs. |
| 163 | |
| 164 | See the `sync` command for usage. |
| 165 | ''' |
| 166 | from .tasks import prepare_pair, metasync_collection |
| 167 | from .utils import WorkerQueue |
| 168 | |
| 169 | wq = WorkerQueue(max_workers) |
| 170 | |
| 171 | with wq.join(): |
| 172 | for pair_name, collections in collections: |
| 173 | wq.put(functools.partial(prepare_pair, pair_name=pair_name, |
| 174 | collections=collections, |
| 175 | config=ctx.config, |
| 176 | callback=metasync_collection)) |
| 177 | wq.spawn_worker() |
| 178 | |
| 179 | |
| 180 | @app.command() |
nothing calls this directly
no test coverage detected