remove unused mutability to defuse deadlock
This commit is contained in:
parent
4d5ea4897c
commit
fceef849cf
|
|
@ -55,7 +55,7 @@ impl Tracing {
|
|||
/// Reload the currently-active filter with the supplied value.
|
||||
///
|
||||
/// This can be used to provide a dynamic tracing filter endpoint.
|
||||
pub fn reload_filter(&mut self, filter: impl Into<EnvFilter>) {
|
||||
pub fn reload_filter(&self, filter: impl Into<EnvFilter>) {
|
||||
self.filter_handle
|
||||
.reload(filter)
|
||||
.expect("the subscriber is not dropped before the component is");
|
||||
|
|
|
|||
|
|
@ -104,10 +104,10 @@ To set the filter, POST the new filter string to /filter:
|
|||
.expect("response with known status code cannot fail"),
|
||||
(&Method::POST, "/filter") => match read_filter(req).await {
|
||||
Ok(filter) => {
|
||||
app_writer()
|
||||
.state_mut()
|
||||
app_reader()
|
||||
.state()
|
||||
.components
|
||||
.get_downcast_mut::<Tracing>()
|
||||
.get_downcast_ref::<Tracing>()
|
||||
.expect("Tracing component should be available")
|
||||
.reload_filter(filter);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue