8000 chore: add files cache for reading template tar archives from db by aslilac · Pull Request #17141 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

chore: add files cache for reading template tar archives from db #17141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 2, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
:|
  • Loading branch information
aslilac committed Apr 1, 2025
commit 2b783c5591a11f08f08b3ba3f1b9c3ee9fd02b19
4 changes: 2 additions & 2 deletions coderd/files/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (c *Cache) prepare(ctx context.Context, fileID uuid.UUID) *lazy.ValueWithEr
c.data[fileID] = entry
}

entry.refCount += 1
entry.refCount++
return entry.value
}

Expand All @@ -98,7 +98,7 @@ func (c *Cache) Release(fileID uuid.UUID) {
// this function with an incorrect ID. Should this function return an error?
return
}
entry.refCount -= 1
entry.refCount--
if entry.refCount > 0 {
return
}
Expand Down
Loading
0