chore: update store cache

This commit is contained in:
Steven
2024-05-12 13:19:31 +08:00
parent 93e8fa4912
commit cf423026a5
6 changed files with 19 additions and 8 deletions

View File

@@ -131,9 +131,11 @@ func (s *Store) GetUser(ctx context.Context, find *FindUser) (*User, error) {
if *find.ID == SystemBotID {
return SystemBot, nil
}
if cache, ok := s.userCache.Load(*find.ID); ok {
return cache.(*User), nil
user, ok := cache.(*User)
if ok {
return user, nil
}
}
}