mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-15 13:16:56 +00:00
abstract async shutdown waiting loop
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
1 parent
0a9b6c136f
commit
9eb99f8070
2 files changed
+13
-8
No files matched your search
@@ -97,13 +97,8 @@ pub async fn watch(&self, user_id: &UserId, device_id: &DeviceId) -> Result {
|
||||
);
|
||||
|
||||
// Server shutdown
|
||||
let server_shutdown = async move {
|
||||
while self.services.server.running() {
|
||||
self.services.server.signal.subscribe().recv().await.ok();
|
||||
}
|
||||
};
|
||||
|
||||
futures.push(server_shutdown.boxed());
|
||||
let server_shutdown = self.services.server.clone().until_shutdown().boxed();
|
||||
futures.push(server_shutdown);
|
||||
if !self.services.server.running() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user