Skip to content

Commit

Permalink
fix: handle deleted mod on virus scanning
Browse files Browse the repository at this point in the history
  • Loading branch information
Vilsol committed Aug 12, 2023
1 parent 5a60c17 commit 4aa7cb0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions redis/jobs/consumers/consumer_scan_mod_on_virus_total.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ func ScanModOnVirusTotalConsumer(ctx context.Context, payload []byte) error {
log.Info().Msgf("starting virus scan of mod %s version %s", task.ModID, task.VersionID)

version := postgres.GetVersion(ctx, task.VersionID)
// Version got deleted?
if version == nil {
log.Error().Msgf("mod %s version %s does not exist to be scanned", task.ModID, task.VersionID)
return nil
}

link := storage.GenerateDownloadLink(version.Key)

response, _ := http.Get(link)
Expand Down

0 comments on commit 4aa7cb0

Please sign in to comment.