Update event import process and improve user feedback
Some checks failed
Go / build-and-release (push) Has been cancelled
Some checks failed
Go / build-and-release (push) Has been cancelled
Simplified event import to run synchronously, ensuring proper resource handling and accurate feedback. Enhanced frontend with real-time import status messages and error handling. Adjusted migrations to handle events individually, improving reliability and granular progress tracking.
This commit is contained in:
@@ -10,10 +10,11 @@ import (
|
||||
)
|
||||
|
||||
// Import a collection of events in line structured minified JSON format (JSONL).
|
||||
// This runs synchronously to ensure the reader remains valid during processing.
|
||||
// The actual event processing happens after buffering to a temp file, so the
|
||||
// caller can close the reader after Import returns.
|
||||
func (d *D) Import(rr io.Reader) {
|
||||
go func() {
|
||||
if err := d.ImportEventsFromReader(d.ctx, rr); chk.E(err) {
|
||||
log.E.F("import failed: %v", err)
|
||||
}
|
||||
}()
|
||||
if err := d.ImportEventsFromReader(d.ctx, rr); chk.E(err) {
|
||||
log.E.F("import failed: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user