mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 10:45:30 +00:00
Add PanicSentinelWatcher
Use to determine if SIGTERM was caused by panic in other thread
This commit is contained in:
parent
3f46db01ff
commit
b61b136b0c
3 changed files with 35 additions and 7 deletions
|
|
@ -7,7 +7,7 @@
|
|||
//! Scrape: 1 873 545 requests/second, 533.75 ns/request
|
||||
//! ```
|
||||
|
||||
use aquatic_common::PanicSentinel;
|
||||
use aquatic_common::PanicSentinelWatcher;
|
||||
use aquatic_udp::workers::request::run_request_worker;
|
||||
use crossbeam_channel::unbounded;
|
||||
use num_format::{Locale, ToFormattedString};
|
||||
|
|
@ -42,6 +42,7 @@ pub fn run(bench_config: BenchConfig) -> ::anyhow::Result<()> {
|
|||
// Setup common state, spawn request handlers
|
||||
|
||||
let mut aquatic_config = Config::default();
|
||||
let (_, sentinel) = PanicSentinelWatcher::create_with_sentinel();
|
||||
|
||||
aquatic_config.cleaning.torrent_cleaning_interval = 60 * 60 * 24;
|
||||
|
||||
|
|
@ -56,7 +57,7 @@ pub fn run(bench_config: BenchConfig) -> ::anyhow::Result<()> {
|
|||
|
||||
::std::thread::spawn(move || {
|
||||
run_request_worker(
|
||||
PanicSentinel,
|
||||
sentinel,
|
||||
config,
|
||||
state,
|
||||
request_receiver,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue