Fixed plugin stop and auth
This commit is contained in:
+5
-4
@@ -63,9 +63,10 @@ impl Plugin {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn stop(&mut self) {
|
||||
self.send(&LoaderMessage::Shutdown).unwrap();
|
||||
self.stream.shutdown(std::net::Shutdown::Both).unwrap();
|
||||
self.child.lock().unwrap().kill().unwrap();
|
||||
pub fn stop(&mut self) -> crate::Result<()> {
|
||||
self.send(&LoaderMessage::Shutdown)?;
|
||||
self.stream.shutdown(std::net::Shutdown::Both)?;
|
||||
self.child.lock().unwrap().kill()?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -258,7 +258,9 @@ impl Server {
|
||||
|
||||
// Stop plugins
|
||||
for plugin in self.plugins.lock().unwrap().iter_mut() {
|
||||
let _ = plugin.stop();
|
||||
if let Err(e) = plugin.stop() {
|
||||
Self::LOGGER.warn(e.context("Couldn't stop plugin"));
|
||||
}
|
||||
}
|
||||
|
||||
Self::LOGGER.info("Shutdown complete");
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ pub fn auth(server: &Arc<Server>, client: &mut Client, token: &str) -> crate::Re
|
||||
|
||||
pub fn test(server: &Arc<Server>) -> crate::Result<()> {
|
||||
ureq::get(format!(
|
||||
"https://vxchat.netlify.app/api/test-auth?key={}&id={}",
|
||||
"https://vxchat.netlify.app/api/auth-test?key={}&id={}",
|
||||
server.config.server_key, server.config.server_id
|
||||
))
|
||||
.call()
|
||||
|
||||
Reference in New Issue
Block a user