use rwlock for command handler.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
5254eb4f72
commit
a3638dbb15
2 changed files with 14 additions and 6 deletions
|
@ -36,13 +36,18 @@ pub async fn init() {
|
|||
.write()
|
||||
.expect("locked for writing")
|
||||
.insert(handler::complete);
|
||||
_ = services().admin.handle.lock().await.insert(handler::handle);
|
||||
_ = services()
|
||||
.admin
|
||||
.handle
|
||||
.write()
|
||||
.await
|
||||
.insert(handler::handle);
|
||||
}
|
||||
|
||||
/// Uninstall the admin command handler
|
||||
#[allow(clippy::let_underscore_must_use)]
|
||||
pub async fn fini() {
|
||||
_ = services().admin.handle.lock().await.take();
|
||||
_ = services().admin.handle.write().await.take();
|
||||
_ = services()
|
||||
.admin
|
||||
.complete
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue