API: Shorten cache debug messages #260
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
parent
75fd1904f3
commit
65212f393f
3 changed files with 6 additions and 6 deletions
|
@ -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)
|
||||
})
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue