code: func (ms *SQLMsgStore) Close() error {
  	ms.Lock()
  	if ms.closed {
  		ms.Unlock()
  		return nil
  	}
  	// Flush before switching the state to closed
  	err := ms.flush()
  	ms.closed = true
  	if ms.expireTimer != nil {
  		if ms.expireTimer.Stop() {
  			ms.wg.Done()
  		}
  	}
  	ms.Unlock()
  
  	ms.wg.Wait()
  	return err
  }
docs: // Close implements the MsgStore interface