🌱 cron: don't write anything for projects without URL (#4095)

We still run into the 429 GCS responses due to the lower limits on the same file.
All of the projects without a repo_url are being mapped to the same
object and leading to rate limiting.

"Maximum rate of writes to the same object name: One write per second"
https://cloud.google.com/storage/quotas#objects

Signed-off-by: Spencer Schrock <sschrock@google.com>
This commit is contained in:
Spencer Schrock 2024-05-08 13:41:39 -07:00 committed by GitHub
parent cc7132d631
commit c92efe9bb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,6 +42,9 @@ func writeToCIIDataBucket(ctx context.Context, pageResp []ciiPageResp, bucketURL
for _, project := range pageResp {
projectURL := strings.TrimPrefix(project.RepoURL, "https://")
projectURL = strings.TrimPrefix(projectURL, "http://")
if projectURL == "" {
continue
}
jsonData, err := clients.BadgeResponse{
BadgeLevel: project.BadgeLevel,
}.AsJSON()