Bug 1890689 accumulate input in LargerReceiverBlockSizeThanDesiredBuffering GTest...
[gecko.git] / taskcluster / gecko_taskgraph / actions / purge_caches.py
blob4905526f6cf3b8a9365424d689ffc9203d7cdf55
1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 import logging
8 from taskgraph.util.taskcluster import get_task_definition, purge_cache
10 from .registry import register_callback_action
12 logger = logging.getLogger(__name__)
15 @register_callback_action(
16 title="Purge Worker Caches",
17 name="purge-cache",
18 symbol="purge-cache",
19 description=(
20 "Purge any caches associated with this task "
21 "across all workers of the same workertype as the task."
23 order=450,
24 context=[{"worker-implementation": "docker-worker"}],
26 def purge_caches_action(parameters, graph_config, input, task_group_id, task_id):
27 task = get_task_definition(task_id)
28 if task["payload"].get("cache"):
29 for cache in task["payload"]["cache"]:
30 purge_cache(
31 task["provisionerId"], task["workerType"], cache, use_proxy=True
33 else:
34 logger.info("Task has no caches. Will not clear anything!")