diff --git a/pkg/actor/simple_grain_pool.go b/pkg/actor/simple_grain_pool.go index 5b0a21c..05a500d 100644 --- a/pkg/actor/simple_grain_pool.go +++ b/pkg/actor/simple_grain_pool.go @@ -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 { return nil, applyErr } - if err := p.storage.AppendEvent(id, mutation); err != nil { - log.Printf("failed to store mutation for grain %d: %v", id, err) + if p.storage != nil { + 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() }