Skip to content

Commit

Permalink
fix featured bots cache (keybase#23770)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblum authored Apr 14, 2020
1 parent a1c568b commit eb5e65f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions go/teambot/featuredbot.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (l *FeaturedBotLoader) syncFeaturedBots(mctx libkb.MetaContext, arg keybase
l.debug(mctx, "syncFeaturedBots: failed to load from server: %s", err)
return res, err
}
if cache != nil && !res.Eq(cache.Data) { // only write out data if it changed
if cache == nil || !res.Eq(cache.Data) { // only write out data if it changed
if err := l.storeFeaturedBots(mctx, arg, res); err != nil {
l.debug(mctx, "syncFeaturedBots: failed to store result: %s", err)
return res, err
Expand All @@ -209,7 +209,6 @@ func (l *FeaturedBotLoader) FeaturedBots(mctx libkb.MetaContext, arg keybase1.Fe
if err != nil {
l.debug(mctx, "FeaturedBots: failed to load from local storage: %s", err)
} else if found {
l.debug(mctx, "FeaturedBots: returning cached data")
l.G().NotifyRouter.HandleFeaturedBots(mctx.Ctx(), l.present(mctx, cache.Data.Bots), arg.Limit, arg.Offset)
go func() {
mctx = libkb.NewMetaContextBackground(l.G())
Expand Down

0 comments on commit eb5e65f

Please sign in to comment.