(key string, dur time.Duration)
| 33 | } |
| 34 | |
| 35 | func (ac *ThreadCache) Set(key string, dur time.Duration) error { |
| 36 | ctx, cancel := context.WithTimeout(context.Background(), ac.wt) |
| 37 | defer cancel() |
| 38 | err := ac.client.Set(ctx, key, true, dur).Err() |
| 39 | if err != nil { |
| 40 | return err |
| 41 | } |
| 42 | |
| 43 | return nil |
| 44 | } |
| 45 | |
| 46 | func (ac *ThreadCache) GetThreadStatus(key string) bool { |
| 47 | ctx, cancel := context.WithTimeout(context.Background(), ac.rt) |