returns old value of IsFlushing
()
| 494 | |
| 495 | // returns old value of IsFlushing |
| 496 | func (s *FileStore) setUnlessFlushing() bool { |
| 497 | s.Lock.Lock() |
| 498 | defer s.Lock.Unlock() |
| 499 | if s.IsFlushing { |
| 500 | return true |
| 501 | } |
| 502 | s.IsFlushing = true |
| 503 | return false |
| 504 | } |
| 505 | |
| 506 | func (s *FileStore) runFlushWithNewContext() (FlushStats, error) { |
| 507 | ctx, cancelFn := context.WithTimeout(context.Background(), DefaultFlushTime) |