| DispatchEvent::ChannelUpdate(_)
if features.contains(&"channels_cache".to_string()) =>
{
- cache.channels.handle(event);
+ cache.channels.handle(event).await;
}
// Guild Cache
| DispatchEvent::CommandPermissionsUpdate(_)
if features.contains(&"guilds_cache".to_string()) =>
{
- cache.guilds.handle(event);
+ cache.guilds.handle(event).await;
}
// Guild Scheduled event
| DispatchEvent::GuildScheduledEventUserRemove(_)
if features.contains(&"guild_schedules_cache".to_string()) =>
{
- cache.guild_schedules.handle(event);
+ cache.guild_schedules.handle(event).await;
}
// Stage events
| DispatchEvent::StageInstanceUpdate(_)
if features.contains(&"stage_instances_cache".to_string()) =>
{
- cache.stage_instances.handle(event);
+ cache.stage_instances.handle(event).await;
}
// Integration events
| DispatchEvent::InteractionCreate(_)
if features.contains(&"integrations_cache".to_string()) =>
{
- cache.integrations.handle(event);
+ cache.integrations.handle(event).await;
}
// Member events
| DispatchEvent::UserUpdate(_)
if features.contains(&"members_cache".to_string()) =>
{
- cache.members.handle(event);
+ cache.members.handle(event).await;
}
// Ban cache
DispatchEvent::BanAdd(_) | DispatchEvent::BanRemove(_)
if features.contains(&"bans_cache".to_string()) =>
{
- cache.bans.handle(event);
+ cache.bans.handle(event).await;
}
// Reaction cache
| DispatchEvent::ReactionRemoveEmoji(_)
if features.contains(&"reactions_cache".to_string()) =>
{
- cache.reactions.handle(event);
+ cache.reactions.handle(event).await;
}
// Message cache
| DispatchEvent::MessageUpdate(_)
if features.contains(&"messages_cache".to_string()) =>
{
- cache.messages.handle(event);
+ cache.messages.handle(event).await;
}
// Thread cache
| DispatchEvent::ThreadUpdate(_)
if features.contains(&"threads_cache".to_string()) =>
{
- cache.threads.handle(event);
+ cache.threads.handle(event).await;
}
// Invite cache
DispatchEvent::InviteCreate(_) | DispatchEvent::InviteDelete(_)
if features.contains(&"invites_cache".to_string()) =>
{
- cache.invites.handle(event);
+ cache.invites.handle(event).await;
}
// Roles cache
| DispatchEvent::RoleUpdate(_)
if features.contains(&"roles_cache".to_string()) =>
{
- cache.roles.handle(event);
+ cache.roles.handle(event).await;
}
// Automod rules
| DispatchEvent::AutoModerationRuleUpdate(_)
if features.contains(&"automoderation_cache".to_string()) =>
{
- cache.automoderation.handle(event);
+ cache.automoderation.handle(event).await;
}
// Voice State
.init()
};
static ref UPSTREAM_CALLS: Counter<u64> = {
- global::meter(&METER_NAME)
+ global::meter(**&METER_NAME)
.u64_counter("rest.upstream_http_requests_total")
.with_description("Amount of requests sent to discord")
.init()
};
static ref TICKET_CALLS: Counter<u64> = {
- global::meter(&METER_NAME)
+ global::meter(**&METER_NAME)
.u64_counter("rest.ticket_http_requests_total")
.with_description("Amount of requests sent to the ratelimiter")
.init()
};
static ref HEADERS_SUBMIT_CALLS: Counter<u64> = {
- global::meter(&METER_NAME)
+ global::meter(**&METER_NAME)
.u64_counter("rest.header_submit_http_requests_total")
.with_description("Amount of requests sent to the ratelimiter")
.init()
};
static ref UPSTREAM_TIMES: Histogram<u64> = {
- global::meter(&METER_NAME)
+ global::meter(**&METER_NAME)
.u64_histogram("rest.upstream_http_request_duration_miliseconds")
.with_description("Time took to request discord")
.init()
};
static ref TICKET_TIMES: Histogram<u64> = {
- global::meter(&METER_NAME)
+ global::meter(**&METER_NAME)
.u64_histogram("rest.ticket_http_request_duration_miliseconds")
.with_description("Time took to get a ticket from the ratelimiter")
.init()
};
static ref HEADERS_SUBMIT_TIMES: Histogram<u64> = {
- global::meter(&METER_NAME)
+ global::meter(**&METER_NAME)
.u64_histogram("rest.header_submit_http_request_duration_miliseconds")
.with_description("Time took to get a ticket from the ratelimiter")
.init()
(bucket, uri_string, path_name(&path))
};
- REQUESTS.add(&cx, 1, &[KeyValue::new("bucket", name)]);
+ REQUESTS.add( 1, &[KeyValue::new("bucket", name)]);
let ticket_start = SystemTime::now();
- TICKET_CALLS.add(&cx, 1, &[KeyValue::new("bucket", name)]);
+ TICKET_CALLS.add(1, &[KeyValue::new("bucket", name)]);
// waits for the request to be authorized
match ratelimiter
.ticket(bucket.clone())
Ok(_) => {
#[allow(clippy::cast_possible_truncation)]
TICKET_TIMES.record(
- &cx,
ticket_start.elapsed()?.as_millis() as u64,
&[KeyValue::new("bucket", name)],
);
*request.uri_mut() = uri;
let span = debug_span!("upstream request to discord");
let upstream_start = SystemTime::now();
- UPSTREAM_CALLS.add(&cx, 1, &[KeyValue::new("bucket", name)]);
+ UPSTREAM_CALLS.add(1, &[KeyValue::new("bucket", name)]);
let resp = match client.request(request).instrument(span).await {
Ok(response) => {
#[allow(clippy::cast_possible_truncation)]
UPSTREAM_TIMES.record(
- &cx,
upstream_start.elapsed()?.as_millis() as u64,
&[KeyValue::new("bucket", name)],
);
.collect();
let headers_start = SystemTime::now();
- HEADERS_SUBMIT_CALLS.add(&cx, 1, &[KeyValue::new("bucket", name)]);
+ HEADERS_SUBMIT_CALLS.add( 1, &[KeyValue::new("bucket", name)]);
ratelimiter
.submit_headers(bucket.clone(), headers)
.instrument(info_span!("submitting headers"))
.await?;
#[allow(clippy::cast_possible_truncation)]
HEADERS_SUBMIT_TIMES.record(
- &cx,
headers_start.elapsed()?.as_millis() as u64,
&[KeyValue::new("bucket", name)],
);