1.4.5 - Added Panic on event loop error
This commit is contained in:
parent
446c8e4369
commit
bb1e61b20d
2 changed files with 10 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "obsessed-yanqing"
|
name = "obsessed-yanqing"
|
||||||
version = "1.4.4"
|
version = "1.4.5"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Evann Regnault"]
|
authors = ["Evann Regnault"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
|
@ -18,7 +18,12 @@ use crate::metrics::core::{AllRegistries, create_registries, Empty, setup_server
|
||||||
use crate::mongo::core::get_all_status_messages;
|
use crate::mongo::core::get_all_status_messages;
|
||||||
|
|
||||||
fn update_daily(ctx: Context, all_registries: Arc<AllRegistries>) {
|
fn update_daily(ctx: Context, all_registries: Arc<AllRegistries>) {
|
||||||
|
let default_panic = std::panic::take_hook();
|
||||||
tokio::task::spawn(async move {
|
tokio::task::spawn(async move {
|
||||||
|
std::panic::set_hook(Box::new(move |info| {
|
||||||
|
default_panic(info);
|
||||||
|
std::process::exit(1);
|
||||||
|
}));
|
||||||
let mut interval = tokio::time::interval(Duration::from_secs(60 * 60));
|
let mut interval = tokio::time::interval(Duration::from_secs(60 * 60));
|
||||||
loop {
|
loop {
|
||||||
get_total_guilds_count(&ctx, &all_registries).await;
|
get_total_guilds_count(&ctx, &all_registries).await;
|
||||||
|
|
Loading…
Reference in a new issue