Skip to content

Commit

Permalink
fix: panic during type assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
HolgerHuo committed Feb 10, 2024
1 parent f4320b5 commit 504a2f9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions handler/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,15 @@ func fetchRemoteImg(url string, subdir string) config.MetaFile {
cacheKey := subdir+":"+helper.HashString(url)

if val, found := config.RemoteCache.Get(cacheKey); found {
log.Infof("Using cache for remote addr: %s", url)
etag = val.(string)
} else {
if etagVal, ok := val.(string); ok {
log.Infof("Using cache for remote addr: %s", url)
etag = etagVal
} else {
config.RemoteCache.Delete(cacheKey)
}
}

if etag == "" {
log.Infof("Remote Addr is %s, pinging for info...", url)
etag = pingURL(url)
if etag != "" {
Expand Down

0 comments on commit 504a2f9

Please sign in to comment.