Skip to content

Commit

Permalink
Merge pull request #303 from apecloud/fix/fix_mysql_structure_fetcher
Browse files Browse the repository at this point in the history
fix stack backtrace missing when panic happens
  • Loading branch information
qianyiwen2019 authored Dec 24, 2024
2 parents b6c7048 + 3219230 commit 0937334
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 3 additions & 1 deletion dt-main/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use std::env;
use std::{env, panic};

use dt_precheck::{config::task_config::PrecheckTaskConfig, do_precheck};
use dt_task::task_runner::TaskRunner;

#[tokio::main]
async fn main() {
env::set_var("RUST_BACKTRACE", "1");

let args: Vec<String> = env::args().collect();
if args.len() < 2 {
panic!("no task_config provided in args");
Expand Down
2 changes: 0 additions & 2 deletions dt-task/src/task_runner.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::{
env,
fs::{self, File},
io::Read,
panic,
Expand Down Expand Up @@ -74,7 +73,6 @@ impl TaskRunner {
self.init_log4rs()?;
}

env::set_var("RUST_BACKTRACE", "1");
panic::set_hook(Box::new(|panic_info| {
log_error!("panic: {}", panic_info);
}));
Expand Down

0 comments on commit 0937334

Please sign in to comment.