Skip to content

Commit

Permalink
fix: add a cache empty warning
Browse files Browse the repository at this point in the history
  • Loading branch information
j178 committed May 3, 2024
1 parent 43719c5 commit 194bc48
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions leetcode/cache_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ func (c *jsonCache) load() {
log.Error("failed to load cache, try updating with `leetgo cache update`", "err", err)
return
}
if len(c.slugs) == 0 {
log.Warn("cache is empty, try updating with `leetgo cache update`")
return
}
if c.Outdated() {
log.Warn("cache is too old, try updating with `leetgo cache update`")
}
Expand Down

0 comments on commit 194bc48

Please sign in to comment.