Fix run log ingest and terminal console layout
This commit is contained in:
@@ -31,7 +31,7 @@ func (svc *CoreService) IngestLogBatch(batch domain.LogBatchIngest) (domain.LogB
|
||||
if err != nil {
|
||||
return domain.LogBatchIngestResult{}, err
|
||||
}
|
||||
if exists && record.LastSeq == batch.LastSeq && record.Checksum == batch.Checksum {
|
||||
if exists && record.LastSeq == batch.LastSeq && logBatchRecordMatches(record, batch) {
|
||||
if err := svc.projectGamePlayerEvents(projectionBatch); err != nil {
|
||||
return domain.LogBatchIngestResult{}, err
|
||||
}
|
||||
@@ -50,7 +50,7 @@ func (svc *CoreService) IngestLogBatch(batch domain.LogBatchIngest) (domain.LogB
|
||||
}
|
||||
return domain.LogBatchIngestResult{}, validationError("log batch conflicts with acknowledged range")
|
||||
}
|
||||
if batch.FirstSeq != stream.LatestSeq+1 {
|
||||
if stream.LatestSeq > 0 && batch.FirstSeq != stream.LatestSeq+1 {
|
||||
return domain.LogBatchIngestResult{}, validationError("log batch firstSeq must follow latest acknowledged sequence")
|
||||
}
|
||||
|
||||
@@ -86,6 +86,16 @@ func (svc *CoreService) IngestLogBatch(batch domain.LogBatchIngest) (domain.LogB
|
||||
}, nil
|
||||
}
|
||||
|
||||
func logBatchRecordMatches(record domain.LogBatchRecord, batch domain.LogBatchIngest) bool {
|
||||
if record.Checksum == batch.Checksum {
|
||||
return true
|
||||
}
|
||||
if len(record.Entries) == 1 && len(batch.Entries) == 1 {
|
||||
return batch.Checksum == validator.LogLineChecksum(record.Entries[0].Line)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// sanitizeGamePlayerNetworkFields removes raw network material before the durable log body is written.
|
||||
func sanitizeGamePlayerNetworkFields(batch *domain.LogBatchIngest) {
|
||||
for index := range batch.Entries {
|
||||
|
||||
Reference in New Issue
Block a user