Skip to content

Commit

Permalink
Remove update logic
Browse files Browse the repository at this point in the history
  • Loading branch information
prathyushpv committed Dec 30, 2024
1 parent 7b8b045 commit 263bde4
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions common/cache/lru.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ package cache

import (
"container/list"
"context"
"sync"
"time"

enumspb "go.temporal.io/api/enums/v1"
"go.temporal.io/api/serviceerror"
"go.temporal.io/server/common/clock"
"go.temporal.io/server/common/metrics"
"go.temporal.io/server/service/history/workflow/update"
)

var (
Expand Down Expand Up @@ -81,10 +79,10 @@ type (
refCount int
size int
}

hasUpdate interface {
UpdateRegistry(ctx context.Context) update.Registry
}
//
//hasUpdate interface {

Check failure on line 83 in common/cache/lru.go

View workflow job for this annotation

GitHub Actions / golangci

comment-spacings: no space between comment delimiter and comment text (revive)
// UpdateRegistry(ctx context.Context) update.Registry
//}

Check failure on line 85 in common/cache/lru.go

View workflow job for this annotation

GitHub Actions / golangci

comment-spacings: no space between comment delimiter and comment text (revive)
)

// Close closes the iterator
Expand Down Expand Up @@ -430,14 +428,10 @@ func (c *lru) tryEvictUntilEnoughSpaceWithSkipEntry(newEntrySize int, existingEn

func (c *lru) tryEvictAndGetPreviousElement(entry *entryImpl, element *list.Element) *list.Element {
if entry.refCount == 0 {
if ctx, ok := entry.value.(hasUpdate); ok {
if ctx.UpdateRegistry(context.Background()).Len() == 0 {
elementPrev := element.Prev()
// currSize will be updated within deleteInternal
c.deleteInternal(element)
return elementPrev
}
}
elementPrev := element.Prev()
// currSize will be updated within deleteInternal
c.deleteInternal(element)
return elementPrev
}
// entry.refCount > 0
// skip, entry still being referenced
Expand Down

0 comments on commit 263bde4

Please sign in to comment.