API: Shorten cache debug messages #260

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-05-22 20:08:28 +02:00
parent 75fd1904f3
commit 65212f393f
3 changed files with 6 additions and 6 deletions

View file

@ -434,7 +434,7 @@ func AlbumThumbnail(router *gin.RouterGroup, conf *config.Config) {
cacheKey := fmt.Sprintf("album-thumbnail:%s:%s", uuid, typeName)
if cacheData, ok := gc.Get(cacheKey); ok {
log.Debugf("album: %s cache hit [%s]", cacheKey, time.Since(start))
log.Debugf("%s cache hit [%s]", cacheKey, time.Since(start))
c.Data(http.StatusOK, "image/jpeg", cacheData.([]byte))
return
}
@ -494,7 +494,7 @@ func AlbumThumbnail(router *gin.RouterGroup, conf *config.Config) {
gc.Set(cacheKey, thumbData, time.Hour)
log.Debugf("album: %s cached [%s]", cacheKey, time.Since(start))
log.Debugf("%s cached [%s]", cacheKey, time.Since(start))
c.Data(http.StatusOK, "image/jpeg", thumbData)
})

View file

@ -26,7 +26,7 @@ func GetFolders(router *gin.RouterGroup, conf *config.Config, root, pathName str
cacheKey := fmt.Sprintf("folders:%s:%t", pathName, recursive)
if cacheData, ok := gc.Get(cacheKey); ok {
log.Debugf("folders: %s cache hit [%s]", cacheKey, time.Since(start))
log.Debugf("%s cache hit [%s]", cacheKey, time.Since(start))
c.JSON(http.StatusOK, cacheData.([]entity.Folder))
return
}
@ -38,7 +38,7 @@ func GetFolders(router *gin.RouterGroup, conf *config.Config, root, pathName str
} else {
gc.Set(cacheKey, folders, time.Minute*5)
log.Debugf("folders: %s cached [%s]", cacheKey, time.Since(start))
log.Debugf("%s cached [%s]", cacheKey, time.Since(start))
}
c.JSON(http.StatusOK, folders)

View file

@ -180,7 +180,7 @@ func LabelThumbnail(router *gin.RouterGroup, conf *config.Config) {
cacheKey := fmt.Sprintf("label-thumbnail:%s:%s", labelUUID, typeName)
if cacheData, ok := gc.Get(cacheKey); ok {
log.Debugf("label: %s cache hit [%s]", cacheKey, time.Since(start))
log.Debugf("%s cache hit [%s]", cacheKey, time.Since(start))
c.Data(http.StatusOK, "image/jpeg", cacheData.([]byte))
return
}
@ -238,7 +238,7 @@ func LabelThumbnail(router *gin.RouterGroup, conf *config.Config) {
gc.Set(cacheKey, thumbData, time.Hour*4)
log.Debugf("label: %s cached [%s]", cacheKey, time.Since(start))
log.Debugf("%s cached [%s]", cacheKey, time.Since(start))
c.Data(http.StatusOK, "image/jpeg", thumbData)
})