pingora icon indicating copy to clipboard operation
pingora copied to clipboard

Add non-exiting methods and implement SIGHUP reload

Open samurai00 opened this issue 4 months ago • 3 comments

Hey team! I've tried to make a few small tweaks to our server to hopefully improve its flexibility and add some reload functionality. Here's what's new:

  • Added pub fn try_bootstrap(&mut self) -> Result<bool> that doesn't call exit
  • Refactored pub fn bootstrap(&mut self) to use the new try_bootstrap method
  • Added pub fn run_server(mut self, enable_daemon: bool) -> Result<bool> that doesn't call exit
  • Kept pub fn run_forever(mut self) -> ! the same, but now it calls run_server under the hood
  • Implemented SIGHUP catching for reloading
  • Added an example server_reload to show how to reload within a tokio runtime

Related issues:

  • #154
  • #292

samurai00 avatar Sep 30 '24 10:09 samurai00