Refresh collection cache for the given pairs.
(ctx, pairs, max_workers, list)
| 190 | @pass_context |
| 191 | @catch_errors |
| 192 | def discover(ctx, pairs, max_workers, list): |
| 193 | ''' |
| 194 | Refresh collection cache for the given pairs. |
| 195 | ''' |
| 196 | from .tasks import discover_collections |
| 197 | from .utils import WorkerQueue |
| 198 | config = ctx.config |
| 199 | wq = WorkerQueue(max_workers) |
| 200 | |
| 201 | with wq.join(): |
| 202 | for pair_name in (pairs or config.pairs): |
| 203 | pair = config.get_pair(pair_name) |
| 204 | |
| 205 | wq.put(functools.partial( |
| 206 | discover_collections, |
| 207 | status_path=config.general['status_path'], |
| 208 | pair=pair, |
| 209 | from_cache=False, |
| 210 | list_collections=list, |
| 211 | )) |
| 212 | wq.spawn_worker() |
| 213 | |
| 214 | |
| 215 | @app.command() |
nothing calls this directly
no test coverage detected