append async
All checks were successful
Build and Publish / Metadata (push) Successful in 9s
Build and Publish / BuildAndDeployAmd64 (push) Successful in 1m28s
Build and Publish / BuildAndDeployArm64 (push) Successful in 4m3s

This commit is contained in:
matst80
2025-10-13 17:23:17 +02:00
parent 10e1affad0
commit 2bf0475335

View File

@@ -370,8 +370,12 @@ func (p *SimpleGrainPool[V]) Apply(id uint64, mutation proto.Message) (*V, error
if applyErr := p.mutationRegistry.Apply(grain, mutation); applyErr != nil { if applyErr := p.mutationRegistry.Apply(grain, mutation); applyErr != nil {
return nil, applyErr return nil, applyErr
} }
if err := p.storage.AppendEvent(id, mutation); err != nil { if p.storage != nil {
log.Printf("failed to store mutation for grain %d: %v", id, err) go func() {
if err := p.storage.AppendEvent(id, mutation); err != nil {
log.Printf("failed to store mutation for grain %d: %v", id, err)
}
}()
} }
return grain.GetCurrentState() return grain.GetCurrentState()
} }