8000 feat: add wsproxy implementation for key fetching by sreya · Pull Request #14917 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat: add wsproxy implementation for key fetching #14917

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 15 commits into from
Oct 14, 2024
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
Refactor key refresh to minimize lock duration
  • Loading branch information
sreya committed Oct 4, 2024
commit a1d4b46917aed142dd879b5a6cccc97d82322825
8 changes: 4 additions & 4 deletions enterprise/wsproxy/keycache.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
Fetch(ctx context.Context) ([]codersdk.CryptoKey, error)
}

var _ cryptokeys.Keycache = &CryptoKeyCache{}

Check failure on line 28 in enterprise/wsproxy/keycache.go

View workflow job for this annotation

GitHub Actions / gen

undefined: cryptokeys.Keycache

Check failure on line 28 in enterprise/wsproxy/keycache.go

View workflow job for this annotation

GitHub Actions / lint

undefined: cryptokeys.Keycache (typecheck)

Check failure on line 28 in enterprise/wsproxy/keycache.go

View workflow job for this annotation

GitHub Actions / lint

undefined: cryptokeys.Keycache) (typecheck)

Check failure on line 28 in enterprise/wsproxy/keycache.go

View workflow job for this annotation

GitHub Actions / lint

undefined: cryptokeys.Keycache) (typecheck)

Check failure on line 28 in enterprise/wsproxy/keycache.go

View workflow job for this annotation

GitHub Actions / lint

undefined: cryptokeys.Keycache) (typecheck)

Check failure on line 28 in enterprise/wsproxy/keycache.go

View workflow job for this annotation

GitHub Actions / test-go (ubuntu-latest)

undefined: cryptokeys.Keycache

Check failure on line 28 in enterprise/wsproxy/keycache.go

View workflow job for this annotation

GitHub Actions / test-go (macos-latest)

undefined: cryptokeys.Keycache

Check failure on line 28 in enterprise/wsproxy/keycache.go

View workflow job for this annotation

GitHub Actions / test-go (macos-latest)

undefined: cryptokeys.Keycache

Check failure on line 28 in enterprise/wsproxy/keycache.go

View workflow job for this annotation

GitHub Actions / test-go-pg

undefined: cryptokeys.Keycache

Check failure on line 28 in enterprise/wsproxy/keycache.go

View workflow job for this annotation

GitHub Actions / test-go-pg

undefined: cryptokeys.Keycache

Check failure on line 28 in enterprise/wsproxy/keycache.go

View workflow job for this annotation

GitHub Actions / test-e2e

undefined: cryptokeys.Keycache

Check failure on line 28 in enterprise/wsproxy/keycache.go

View workflow job for this annotation

GitHub Actions / test-go-pg-16

undefined: cryptokeys.Keycache

Check failure on line 28 in enterprise/wsproxy/keycache.go

View workflow job for this annotation

GitHub Actions / test-go-pg-16

undefined: cryptokeys.Keycache

Check failure on line 28 in enterprise/wsproxy/keycache.go

View workflow job for this annotation

GitHub Actions / test-e2e-enterprise

undefined: cryptokeys.Keycache

Check failure on line 28 in enterprise/wsproxy/keycache.go

View workflow job for this annotation

GitHub Actions / test-go-race

undefined: cryptokeys.Keycache

type CryptoKeyCache struct {
Clock quartz.Clock
Expand Down Expand Up @@ -148,14 +148,14 @@

// refresh fetches the keys from the control plane and updates the cache.
func (k *CryptoKeyCache) refresh() {
now := k.Clock.Now("CryptoKeyCache", "refresh")
k.mu.Lock()

if k.closed {
k.mu.Unlock()
return
}

now := k.Clock.Now("CryptoKeyCache", "refresh")

k.mu.Lock()

// If something's already fetching, we don't need to do anything.
if k.fetching {
k.mu.Unlock()
Expand Down
Loading
0