mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat(gateway): add /shard_status endpoint
This commit is contained in:
parent
e2acaf93be
commit
b5f18106e1
3 changed files with 51 additions and 20 deletions
|
|
@ -91,8 +91,10 @@ async fn main() -> anyhow::Result<()> {
|
|||
)));
|
||||
}
|
||||
|
||||
let shard_state = Arc::new(discord::shard_state::new(redis.clone()));
|
||||
|
||||
set.spawn(tokio::spawn({
|
||||
let mut shard_state = discord::shard_state::new(redis.clone());
|
||||
let shard_state = shard_state.clone();
|
||||
|
||||
async move {
|
||||
while let Some((shard_id, state_event, parsed_event, latency)) = state_rx.recv().await {
|
||||
|
|
@ -187,7 +189,7 @@ async fn main() -> anyhow::Result<()> {
|
|||
));
|
||||
|
||||
set.spawn(tokio::spawn(async move {
|
||||
match cache_api::run_server(cache, runtime_config, awaiter.clone()).await {
|
||||
match cache_api::run_server(cache, shard_state, runtime_config, awaiter.clone()).await {
|
||||
Err(error) => {
|
||||
error!(?error, "failed to serve cache api");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue