fix 100% cpu
This commit is contained in:
parent
614e1900b7
commit
f65a496d51
@ -37,7 +37,7 @@ impl FlowgateServer {
|
||||
FlowgateServer { config }
|
||||
}
|
||||
|
||||
pub async fn start(self) {
|
||||
pub async fn run(self) {
|
||||
let local_self = Arc::new(self);
|
||||
|
||||
tokio::spawn({
|
||||
@ -45,10 +45,7 @@ impl FlowgateServer {
|
||||
async move { local_self.run_http().await.ignore(); }
|
||||
});
|
||||
|
||||
tokio::spawn({
|
||||
let local_self = local_self.clone();
|
||||
async move { local_self.run_https().await.ignore(); }
|
||||
});
|
||||
local_self.run_https().await.ignore();
|
||||
}
|
||||
|
||||
pub async fn run_http(self: Arc<Self>) -> Result<(), Box<dyn Error>> {
|
||||
|
@ -14,7 +14,6 @@ async fn main() {
|
||||
let config = Arc::new(Config::parse("conf.yml").unwrap());
|
||||
let server = FlowgateServer::new(config.clone());
|
||||
|
||||
server.start().await;
|
||||
|
||||
loop {}
|
||||
// server.start().await;
|
||||
server.run().await;
|
||||
}
|
Loading…
Reference in New Issue
Block a user