Giter Club home page Giter Club logo

Comments (5)

pietroalbini avatar pietroalbini commented on September 20, 2024

Thanks for pointing this out!

I think I fixed the performance issues (it doesn't use as much CPU anymore on my local machine), can you check on your ones with the latest commit from master? Remember the master branch uses configuration files instead of CLI arguments, in preparation for packaging.

from fisher.

piaoger avatar piaoger commented on September 20, 2024

thanks,it reduces cpu usage.

On the other hand, it seems that you just increase the wait time and I wonder if there are any side effects?

from fisher.

pietroalbini avatar pietroalbini commented on September 20, 2024

It shouldn't have any side effects, because the wait method returns as soon as the signal is received.

from fisher.

piaoger avatar piaoger commented on September 20, 2024

I almost forgot fisher does not compiled in Mac because signal::trap::Trap::trap::wait(...) is only provided for Linux.

I added a simple workaround so that I can have a test in my Macbook Pro :)

    // Wait for signals
    loop {
        let deadline = Instant::now() + Duration::from_secs(60);

        // signal::trap::Trap::trap::wait(...) is only provided for Linux.
        #[cfg(target_os = "linux")]
        match signal_trap.wait(deadline) {
            Some(SIGINT) | Some(SIGTERM) => break,
            Some(SIGUSR1) => {
                println!("Reloading configuration and scripts...");

                // Don't crash if the reload fails, just show errors
                // No changes are applied if the reload fails
                match read_config(&config_path) {
                    Ok(new_config) => {
                        if let Err(err) = app.reload(new_config) {
                            err.pretty_print()
                        }
                    }
                    Err(err) => err.pretty_print(),
                }
            }
            _ => {}
        }

        #[cfg(target_os = "macos")]
        ::std::thread::sleep(Duration::new(0, 60000));
    }

from fisher.

pietroalbini avatar pietroalbini commented on September 20, 2024

Closing this, I opened #13 for the macOS problem.

from fisher.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.