Skip to content

Commit

Permalink
Merge pull request #68 from buildkite/ivannalisetska/SUP-2620
Browse files Browse the repository at this point in the history
add how to handle 504 error with concurrency get request
  • Loading branch information
gilesgas authored Dec 24, 2024
2 parents e41944d + 02209e1 commit d132d67
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion pages/apis/graphql/cookbooks/jobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,28 @@ To see which jobs are waiting for a concurrency group in case the secret URL fai

```
query getConcurrency {
organization(slug: "{org}") {
organization(slug: "organization-slug") {
jobs(first:100,concurrency:{group:"name"}, type:[COMMAND], state:[LIMITED,WAITING,ASSIGNED]) {
edges {
node {
... on JobTypeCommand {
url
createdAt
}
}
}
}
}
}
```

### Handling 504 errors

When attempting to get all jobs in a particular concurrency group throughout your Buildkite organization, you might receive a 504 error in the response, which could result from your specific query being too resource-intensive for the Buildkite GraphQL API to resolve. In such circumstances, restrict the query by a specific pipeline, using its slug.

```
query getConcurrency {
organization(slug: "organization-slug/pipeline-slug") {
jobs(first:100,concurrency:{group:"name"}, type:[COMMAND], state:[LIMITED,WAITING,ASSIGNED]) {
edges {
node {
Expand All @@ -64,6 +85,7 @@ query getConcurrency {
}
}
```

## Get the last job of an agent

To get the last job of an agent or `null`. You will need to know the UUID of the agent.
Expand Down

0 comments on commit d132d67

Please sign in to comment.