Skip to content

Commit

Permalink
[preprocessor/webhook] use int64 for filesize
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Jun 19, 2024
1 parent 6bba3aa commit 774ed49
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webhook/browsertrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type BrowsertrixCrawlFinishedResponse struct {
Path string `json:"path"`
Hash string `json:"hash"`
Crc32 int `json:"crc32"`
Size int `json:"size"`
Size int64 `json:"size"`
CrawlID string `json:"crawlId"`
NumReplicas int `json:"numReplicas"`
ExpireAt string `json:"expireAt"`
Expand Down Expand Up @@ -251,7 +251,7 @@ func handleBrowsertrixEvent(w http.ResponseWriter, r *http.Request) {
return
}

if int(fileAttributes["file_size"].(int64)) != e.Resources[0].Size {
if fileAttributes["file_size"].(int64) != e.Resources[0].Size {
log.Printf("Size mismatch: %d != %d", fileAttributes["file_size"], e.Resources[0].Size)
writeJsonResponse(w, http.StatusInternalServerError, map[string]string{"error": "size mismatch"})
return
Expand Down

0 comments on commit 774ed49

Please sign in to comment.