Merge branch 'main' into fix/issue-3
This commit is contained in:
@@ -169,8 +169,8 @@ func (s *Service) processFromSourceOrFetch(
|
||||
}
|
||||
}
|
||||
|
||||
// Fetch from upstream if we don't have source data
|
||||
if sourceData == nil {
|
||||
// Fetch from upstream if we don't have source data or it's empty
|
||||
if len(sourceData) == 0 {
|
||||
resp, err := s.fetchAndProcess(ctx, req, cacheKey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -280,7 +280,11 @@ func (s *Service) processAndStore(
|
||||
|
||||
// Log conversion details
|
||||
outputSize := int64(len(processedData))
|
||||
sizePercent := float64(outputSize) / float64(fetchBytes) * 100.0 //nolint:mnd // percentage calculation
|
||||
|
||||
var sizePercent float64
|
||||
if fetchBytes > 0 {
|
||||
sizePercent = float64(outputSize) / float64(fetchBytes) * 100.0 //nolint:mnd // percentage calculation
|
||||
}
|
||||
|
||||
s.log.Info("image converted",
|
||||
"host", req.SourceHost,
|
||||
|
||||
Reference in New Issue
Block a user