MCPcopy
hub / github.com/pimutils/vdirsyncer / discover

Function discover

vdirsyncer/cli/__init__.py:192–212  ·  view source on GitHub ↗

Refresh collection cache for the given pairs.

(ctx, pairs, max_workers, list)

Source from the content-addressed store, hash-verified

190@pass_context
191@catch_errors
192def 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()

Callers

nothing calls this directly

Calls 5

joinMethod · 0.95
putMethod · 0.95
spawn_workerMethod · 0.95
WorkerQueueClass · 0.85
get_pairMethod · 0.80

Tested by

no test coverage detected