Skip to content

Commit 1705535

Browse files
committed
worker: explain why typosquat cache only builds once
1 parent 5f6298a commit 1705535

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/worker/environment.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ impl Environment {
7979
) -> Result<&typosquat::Cache, typosquat::CacheError> {
8080
// We have to pass conn back in here because the caller might be in a transaction, and
8181
// getting a new connection here to query crates can result in a deadlock.
82+
//
83+
// Note that this intentionally won't retry if the initial call to `from_env` fails:
84+
// typosquatting checks aren't on the critical path for publishing, and a warning will be
85+
// generated if initialising the cache fails.
8286
self.typosquat_cache
8387
.get_or_init(|| typosquat::Cache::from_env(conn))
8488
.as_ref()

0 commit comments

Comments
 (0)