code: func (sl *DiskSessionLogger) flush() error {
  	var err, err2 error
  
  	if sl.RecordSessions && sl.chunksFile != nil {
  		err = sl.chunksFile.Flush()
  	}
  	if sl.eventsFile != nil {
  		err2 = sl.eventsFile.Flush()
  	}
  	return trace.NewAggregate(err, err2)
  }
docs: // flush is used to flush gzip frames to file, otherwise
  // some attempts to read the file could fail