Skip to content

Commit

Permalink
fix session event handling
Browse files Browse the repository at this point in the history
  • Loading branch information
gernest committed Feb 23, 2024
1 parent cc265db commit 6706d94
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions internal/session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ func (s *Session) process(ctx context.Context, req *v1.Event) {
events.Hit(e)
if o, ok := s.cache.Get(e.Id); ok {
cached := o.(*eventsv1.Data)
defer events.PutOne(e)
s.mu.Lock()
// cached can be accessed concurrently. Protect it together with build.
events.Update(cached, e)
Expand All @@ -156,7 +155,7 @@ func (s *Session) process(ctx context.Context, req *v1.Event) {
s.mu.Lock()
s.list.Items = append(s.list.Items, e)
s.mu.Unlock()
s.cache.SetWithTTL(e.Id, e, int64(proto.Size(e)), DefaultSession)
s.cache.SetWithTTL(e.Id, events.Clone(e), int64(proto.Size(e)), DefaultSession)
}

func (s *Session) Scan(ctx context.Context, start, end int64, fs *v1.Filters) (arrow.Record, error) {
Expand Down

0 comments on commit 6706d94

Please sign in to comment.