Skip to content

When writter is nil, we should not ingest events #104

Description

@atlas-comstock
// WriteBlock writes a one or multiple blocks to the underlying writer.
func (s *Flusher) WriteBlock(blocks []block.Block, schema typeof.Schema) error {
	if s.writer == nil || len(blocks) == 0 {
		return nil
	}

	// Merge the blocks based on the specified merging function
	// buffer, err := s.merge(blocks, schema)
	// if err != nil {
	//     return err
	// }

	// Generate the file name and write the data to the underlying writer
	return s.writer.Write(s.generateFileName(blocks[0]), blocks)
}

In Flusher, we should return an error when the writer is nil, otherwise, the badgerDB data will be deleted without writing to any writter.
It would be better to keep them in badgerDB

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions