Skip to content

Commit cc85492

Browse files
authored
Fix report creation for big files (#17)
1 parent b6a862d commit cc85492

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pkg/database/report.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ func (r *ReportClient) Create(report *Report) error {
9999
if report.IsFile {
100100
hash, err := ComputeFileHash(report.FilePath)
101101
if err != nil {
102-
return err
102+
return fmt.Errorf("failed to compute file hash: %w", err)
103103
}
104104
report.FileHash = hash
105105
}
106106

107-
result := r.db.Omit("IPs.*").Create(report)
107+
result := r.db.Omit("IPs").Create(report)
108108
if result.Error != nil {
109-
return result.Error
109+
return fmt.Errorf("creating report in database failed: %v", result.Error)
110110
}
111111

112112
allIPs := report.IPs

0 commit comments

Comments
 (0)