From dd27a28cfab4d207c3161e44f5895e33a162fa5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=B1=E3=82=A4=E3=83=A9?= Date: Tue, 10 Jun 2025 15:36:48 -0600 Subject: [PATCH] chore: fix comment on `Acquire` (#18313) --- coderd/files/cache.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/coderd/files/cache.go b/coderd/files/cache.go index 48587eb402..92b8ea33ed 100644 --- a/coderd/files/cache.go +++ b/coderd/files/cache.go @@ -134,7 +134,8 @@ type fetcher func(context.Context, uuid.UUID) (cacheEntryValue, error) // calls for the same fileID will only result in one fetch, and that parallel // calls for distinct fileIDs will fetch in parallel. // -// Every call to Acquire must have a matching call to Release. +// Safety: Every call to Acquire that does not return an error must have a +// matching call to Release. func (c *Cache) Acquire(ctx context.Context, fileID uuid.UUID) (fs.FS, error) { // It's important that this `Load` call occurs outside of `prepare`, after the // mutex has been released, or we would continue to hold the lock until the