Skip to content

Commit

Permalink
fix: correct usage of upgrade variable
Browse files Browse the repository at this point in the history
  • Loading branch information
samurai00 committed Nov 4, 2024
1 parent e3b9613 commit 1523d32
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pingora/examples/server_reload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ mod app;
mod service;

pub fn main() {
env_logger::Builder::new()
.filter_level(log::LevelFilter::Info)
.init();
env_logger::init();

let rt = tokio::runtime::Builder::new_multi_thread()
.worker_threads(1)
Expand All @@ -31,6 +29,7 @@ pub fn main() {
loop {
let conf_filename = conf_filename.clone();
let upgrade = upgrade.clone();
let upgrade_for_store = upgrade.clone();
let task = tokio::spawn(async move {
let opt = Opt {
conf: conf_filename,
Expand Down Expand Up @@ -70,7 +69,7 @@ pub fn main() {
_ = reload_signal.recv() => {
#[cfg(target_os = "linux")]
{
upgrade.store(true, Ordering::SeqCst);
upgrade_for_store.store(true, Ordering::SeqCst);
}
#[cfg(not(target_os = "linux"))]
{
Expand Down

0 comments on commit 1523d32

Please sign in to comment.