File tree 1 file changed +12
-4
lines changed
1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 35
35
TC_SCHEMA_URL = 'http://schemas.taskcluster.net/scheduler/v1/task-graph.json'
36
36
TC_INDEX_URL = 'https://index.taskcluster.net/v1/task/'
37
37
TC_QUEUE_URL = 'https://queue.taskcluster.net/v1/task/'
38
+ TC_ARTIFACTS_CACHE = {}
38
39
39
40
40
41
class TaskClusterManager (BaseCIManager ):
@@ -454,13 +455,20 @@ def get_artifact_for_task_id(task_id, artifact_path):
454
455
"""
455
456
This is a generic function which downloads a TaskCluster artifact in plain text.
456
457
"""
458
+ global TC_ARTIFACTS_CACHE
459
+
457
460
if task_id is None or len (task_id ) == 0 :
458
461
raise TaskClusterError ("Please input a valid Task ID to fetch the artifact." )
459
462
url = TC_QUEUE_URL + task_id + "/artifacts/" + artifact_path
460
- resp = requests .get (url )
461
- if resp .status_code != 200 :
462
- raise TaskClusterArtifactError ("Please check your Task ID and artifact path." )
463
- return resp .text
463
+
464
+ try :
465
+ TC_ARTIFACTS_CACHE [task_id ][artifact_path ]
466
+ except Exception as e :
467
+ handle_exception (e )
468
+ resp = requests .get (url )
469
+ if resp .status_code != 200 :
470
+ raise TaskClusterArtifactError ("Please check your Task ID and artifact path." )
471
+ return resp .text
464
472
465
473
466
474
def is_taskcluster_label (task_label , decision_task_id ):
You can’t perform that action at this time.
0 commit comments