mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 04:55:42 +09:00
chore(svc): replace deprecated fetch_update with try_update (#3407)
Signed-off-by: Qsie <[email protected]>
This commit is contained in:
5 files changed
+5
-5
No files matched your search
@@ -175,7 +175,7 @@ impl CacheTelemetry {
|
||||
|
||||
fn next_generation(&self) -> u64 {
|
||||
self.next_generation
|
||||
.fetch_update(METRICS_ORDERING, METRICS_ORDERING, |generation| {
|
||||
.try_update(METRICS_ORDERING, METRICS_ORDERING, |generation| {
|
||||
generation.checked_add(1)
|
||||
})
|
||||
.expect("GIF cache generation exhausted")
|
||||
|
||||
@@ -43,7 +43,7 @@ impl ByteBudgetInner {
|
||||
assert!(amount <= self.limit);
|
||||
let released = self
|
||||
.used
|
||||
.fetch_update(Ordering::AcqRel, Ordering::Acquire, |used| {
|
||||
.try_update(Ordering::AcqRel, Ordering::Acquire, |used| {
|
||||
used.checked_sub(amount)
|
||||
});
|
||||
assert!(released.is_ok());
|
||||
|
||||
@@ -63,7 +63,7 @@ impl HttpRequestDrain {
|
||||
fn begin_request(&self) -> ActiveHttpRequest {
|
||||
self.inner
|
||||
.active_requests
|
||||
.fetch_update(Ordering::AcqRel, Ordering::Acquire, |active| {
|
||||
.try_update(Ordering::AcqRel, Ordering::Acquire, |active| {
|
||||
active.checked_add(1)
|
||||
})
|
||||
.expect("http active request count must not overflow");
|
||||
|
||||
@@ -239,7 +239,7 @@ impl NativeTaskTracker {
|
||||
}
|
||||
self.inner
|
||||
.active
|
||||
.fetch_update(Ordering::AcqRel, Ordering::Acquire, |active| {
|
||||
.try_update(Ordering::AcqRel, Ordering::Acquire, |active| {
|
||||
active.checked_add(1)
|
||||
})
|
||||
.expect("native task count must not overflow");
|
||||
|
||||
@@ -214,7 +214,7 @@ impl UserCaches {
|
||||
async fn invalidate(&self, user_id: i64) {
|
||||
let generation = self
|
||||
.generation(user_id)
|
||||
.fetch_update(Ordering::SeqCst, Ordering::SeqCst, |current| {
|
||||
.try_update(Ordering::SeqCst, Ordering::SeqCst, |current| {
|
||||
current.checked_add(1)
|
||||
})
|
||||
.expect("user cache generation exhausted");
|
||||
|
||||
Reference in new issue
Block a user