mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-03 15:06:36 +08:00
refactor(drivers): decouple inproc cron from inproc worker and satisfy linter
This commit is contained in:
@@ -37,7 +37,7 @@ func newMemoryCacheService(capacity int, events *core.EventBus) (*memoryCacheSer
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *memoryCacheService) Get(ctx context.Context, key string, target any) error {
|
||||
func (s *memoryCacheService) Get(_ context.Context, key string, target any) error {
|
||||
if entry, ok := s.ramCache.GetIfPresent(key); ok {
|
||||
if entry.expireAt.IsZero() || time.Now().Before(entry.expireAt) {
|
||||
return json.Unmarshal(entry.data, target)
|
||||
@@ -48,7 +48,7 @@ func (s *memoryCacheService) Get(ctx context.Context, key string, target any) er
|
||||
return contracts.ErrCacheMiss
|
||||
}
|
||||
|
||||
func (s *memoryCacheService) Set(ctx context.Context, key string, value any, ttl time.Duration) error {
|
||||
func (s *memoryCacheService) Set(_ context.Context, key string, value any, ttl time.Duration) error {
|
||||
data, err := json.Marshal(value)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user