Skip to content

Commit

Permalink
Update packages/next-swc/crates/napi/src/lib.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Benjamin Woodruff <benjamin.woodruff@vercel.com>
  • Loading branch information
wbinnssmith and bgw authored Jul 16, 2024
1 parent eacbf2f commit fd31b6c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/next-swc/crates/napi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ fn init() {
use std::{fs::OpenOptions, io};

set_hook(Box::new(|panic_info| {
// hold open this mutex guard to prevent concurrent writes to the file!
let mut last_error_time = LOG_THROTTLE.lock().unwrap();
if let Some(last_error_time) = last_error_time.as_ref() {
if last_error_time.elapsed().as_secs() < 1 {
Expand Down

0 comments on commit fd31b6c

Please sign in to comment.