Skip to content

Commit d0a058f

Browse files
authored
fix: Update the size of each batch to 100 and total batch size to 300 in codegen.yaml
1 parent 7af3b8c commit d0a058f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/codegen.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
on:
22
schedule:
3-
# Runs at 00:30 and 02:30.
4-
- cron: '30 0,2 * * *'
3+
# Runs at 12:30, 1:30 and 2:30.
4+
- cron: '30 0-2 * * *'
55
workflow_dispatch:
66

77
name: codegen
@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
script: |
1919
console.log('checking size of services')
20-
const MAX_SERVICE_SIZE = 400 // 00:30 and 02:30 implies 2 batches of size 200
20+
const MAX_SERVICE_SIZE = 300 // 00:30 to 02:30 implies 3 batches of size 100
2121
const services = ${{ needs.discovery.outputs.services }}
2222
if (services.length > MAX_SERVICE_SIZE) {
2323
throw new Error(`Total services (${services.length}) exceed limit of ${MAX_SERVICE_SIZE}`)
@@ -35,7 +35,7 @@ jobs:
3535
console.log('splitting service names list into batches')
3636
const services = ${{ needs.discovery.outputs.services }}
3737
const hour = new Date().getHours()
38-
const MAX_BATCH_SIZE = 200
38+
const MAX_BATCH_SIZE = 100
3939
const result = {
4040
batches: [],
4141
hour: new Date().getHours(),
@@ -48,6 +48,7 @@ jobs:
4848
uses: googleapis/google-api-java-client-services/.github/workflows/generate.yaml@main
4949
needs: batch
5050
secrets: inherit
51+
# The number of batch is implicitly decided by the hour of the day
5152
if: ${{!!fromJson(needs.batch.outputs.services).batches[fromJson(needs.batch.outputs.services).hour]}}
5253
with:
5354
services: ${{toJson(fromJson(needs.batch.outputs.services).batches[fromJson(needs.batch.outputs.services).hour])}}

0 commit comments

Comments
 (0)