fix: include shard_id in redis channel

This commit is contained in:
spiral 2022-05-10 07:32:14 -04:00
parent abb01aaf2c
commit 799279054d
No known key found for this signature in database
GPG key ID: 244A11E4B0BCF40E
4 changed files with 23 additions and 15 deletions

View file

@ -41,7 +41,7 @@ pub async fn handle_event<'a>(
let deserializer = GatewayEventDeserializer::from_json(std::str::from_utf8(&payload.bytes)?).unwrap();
if deserializer.op() == 0 && ALLOWED_EVENTS.contains(&deserializer.event_type_ref().unwrap()) {
let mut conn = rconn.get_async_connection().await?;
conn.publish::<&str, Vec<u8>, i32>("evt", payload.bytes).await?;
conn.publish::<&str, Vec<u8>, i32>(&format!("evt-{shard_id}"), payload.bytes).await?;
}
}
Event::MessageCreate(msg) => {