mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-15 18:20:11 +00:00
fix(gateway): only send relevant events to shard state manager
This commit is contained in:
parent
05817afdba
commit
73103dc2b5
2 changed files with 10 additions and 7 deletions
|
|
@ -175,13 +175,15 @@ pub async fn runner(
|
|||
.increment(1);
|
||||
|
||||
// update shard state and discord cache
|
||||
if let Err(error) = tx_state.try_send((
|
||||
shard.id(),
|
||||
ShardStateEvent::Other,
|
||||
Some(event.clone()),
|
||||
None,
|
||||
)) {
|
||||
tracing::error!(?error, "error updating shard state");
|
||||
if matches!(event, Event::Ready(_)) || matches!(event, Event::Resumed) {
|
||||
if let Err(error) = tx_state.try_send((
|
||||
shard.id(),
|
||||
ShardStateEvent::Other,
|
||||
Some(event.clone()),
|
||||
None,
|
||||
)) {
|
||||
tracing::error!(?error, "error updating shard state");
|
||||
}
|
||||
}
|
||||
// need to do heartbeat separately, to get the latency
|
||||
let latency_num = shard
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue