Skip to content

Commit

Permalink
Merge pull request #18 from application-research/car-file-support
Browse files Browse the repository at this point in the history
fix the max retries
  • Loading branch information
alvin-reyes committed Apr 14, 2023
2 parents de9a811 + 3c9bb15 commit d198825
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/gateway.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// It takes a path, parses it, and returns the protocol, the CID, and the path segments
// Package api It takes a path, parses it, and returns the protocol, the CID, and the path segments
package api

import (
Expand Down
4 changes: 3 additions & 1 deletion jobs/upload_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,10 @@ func (r *UploadToEstuaryProcessor) Run() error {
req.Header.Set("Authorization", "Bearer "+r.Content.RequestingApiKey)
client := &http.Client{}
var res *http.Response
fmt.Println("Sending request to delta node")
for j := 0; j < maxRetries; j++ {
res, err = client.Do(req)
fmt.Println("Response from delta node: ", res)
if err != nil || res.StatusCode != http.StatusOK {
fmt.Printf("Error sending request (attempt %d): %v\n", j+1, err)
time.Sleep(retryInterval)
Expand Down Expand Up @@ -245,11 +247,11 @@ func (r *UploadToEstuaryProcessor) Run() error {
r.LightNode.DB.Save(&replicatedContentModel)
//}
}
break
}
}
}
}
break
}

return nil
Expand Down

0 comments on commit d198825

Please sign in to comment.