Skip to content

Commit 97d2cfe

Browse files
[CI] Try Moving Github Object Into Loop
Currently the metrics container is crashing reasonably often with incomplete read/connection broken errors. Try moving the creation of the Github Object into the main loop to see if recreating the object that maybe handles some connection state fixes the issue. Reviewers: Keenuts, lnihlen Reviewed By: lnihlen Pull Request: llvm#127276
1 parent f7a2d70 commit 97d2cfe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.ci/metrics/metrics.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,6 @@ def upload_metrics(workflow_metrics, metrics_userid, api_key):
255255
def main():
256256
# Authenticate with Github
257257
auth = Auth.Token(os.environ["GITHUB_TOKEN"])
258-
github_object = Github(auth=auth)
259-
github_repo = github_object.get_repo("llvm/llvm-project")
260258

261259
grafana_api_key = os.environ["GRAFANA_API_KEY"]
262260
grafana_metrics_userid = os.environ["GRAFANA_METRICS_USERID"]
@@ -268,6 +266,9 @@ def main():
268266
# Enter the main loop. Every five minutes we wake up and dump metrics for
269267
# the relevant jobs.
270268
while True:
269+
github_object = Github(auth=auth)
270+
github_repo = github_object.get_repo("llvm/llvm-project")
271+
271272
current_metrics = get_per_workflow_metrics(github_repo, workflows_to_track)
272273
current_metrics += get_sampled_workflow_metrics(github_repo)
273274

0 commit comments

Comments
 (0)