fix: 优化调度快照缓存以避免 Redis 大 MGET
This commit is contained in:
@@ -34,7 +34,12 @@ func (f *fakeSchedulerCache) GetSnapshot(_ context.Context, _ service.SchedulerB
|
||||
func (f *fakeSchedulerCache) SetSnapshot(_ context.Context, _ service.SchedulerBucket, _ []service.Account) error {
|
||||
return nil
|
||||
}
|
||||
func (f *fakeSchedulerCache) GetAccount(_ context.Context, _ int64) (*service.Account, error) {
|
||||
func (f *fakeSchedulerCache) GetAccount(_ context.Context, id int64) (*service.Account, error) {
|
||||
for _, account := range f.accounts {
|
||||
if account != nil && account.ID == id {
|
||||
return account, nil
|
||||
}
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
func (f *fakeSchedulerCache) SetAccount(_ context.Context, _ *service.Account) error { return nil }
|
||||
|
||||
Reference in New Issue
Block a user