chore(svc): replace deprecated fetch_update with try_update (#3407)

Signed-off-by: Qsie <[email protected]>
This commit is contained in:
Qsie authored and GitHub committed 2026-10-11 23:30:31 +02:00
1 parent 74c6fad260
commit f8d3c70a91
5 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -175,7 +175,7 @@ impl CacheTelemetry {
fn next_generation(&self) -> u64 { fn next_generation(&self) -> u64 {
self.next_generation self.next_generation
.fetch_update(METRICS_ORDERING, METRICS_ORDERING, |generation| { .try_update(METRICS_ORDERING, METRICS_ORDERING, |generation| {
generation.checked_add(1) generation.checked_add(1)
}) })
.expect("GIF cache generation exhausted") .expect("GIF cache generation exhausted")
+1 -1
View File
@@ -43,7 +43,7 @@ impl ByteBudgetInner {
assert!(amount <= self.limit); assert!(amount <= self.limit);
let released = self let released = self
.used .used
.fetch_update(Ordering::AcqRel, Ordering::Acquire, |used| { .try_update(Ordering::AcqRel, Ordering::Acquire, |used| {
used.checked_sub(amount) used.checked_sub(amount)
}); });
assert!(released.is_ok()); assert!(released.is_ok());
+1 -1
View File
@@ -63,7 +63,7 @@ impl HttpRequestDrain {
fn begin_request(&self) -> ActiveHttpRequest { fn begin_request(&self) -> ActiveHttpRequest {
self.inner self.inner
.active_requests .active_requests
.fetch_update(Ordering::AcqRel, Ordering::Acquire, |active| { .try_update(Ordering::AcqRel, Ordering::Acquire, |active| {
active.checked_add(1) active.checked_add(1)
}) })
.expect("http active request count must not overflow"); .expect("http active request count must not overflow");
@@ -239,7 +239,7 @@ impl NativeTaskTracker {
} }
self.inner self.inner
.active .active
.fetch_update(Ordering::AcqRel, Ordering::Acquire, |active| { .try_update(Ordering::AcqRel, Ordering::Acquire, |active| {
active.checked_add(1) active.checked_add(1)
}) })
.expect("native task count must not overflow"); .expect("native task count must not overflow");
+1 -1
View File
@@ -214,7 +214,7 @@ impl UserCaches {
async fn invalidate(&self, user_id: i64) { async fn invalidate(&self, user_id: i64) {
let generation = self let generation = self
.generation(user_id) .generation(user_id)
.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |current| { .try_update(Ordering::SeqCst, Ordering::SeqCst, |current| {
current.checked_add(1) current.checked_add(1)
}) })
.expect("user cache generation exhausted"); .expect("user cache generation exhausted");