From fe16a923190243dfde5db6ceff2ef0bcf9158926 Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Tue, 1 Oct 2024 13:15:24 -0500 Subject: feat: simplify service status type --- src/service.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/service.rs') diff --git a/src/service.rs b/src/service.rs index c45fcb1..8e0863c 100644 --- a/src/service.rs +++ b/src/service.rs @@ -6,7 +6,7 @@ use serde::Deserialize; use systemd::Systemd; use tcp::Tcp; use tokio::{ - sync::watch::{Receiver, Sender}, + sync::watch::{channel, Receiver, Sender}, task::JoinHandle, }; use tokio_stream::wrappers::WatchStream; @@ -34,7 +34,7 @@ pub struct ServiceHandle { impl ServiceHandle { pub fn new(service: impl ServiceSpawner) -> Self { - let (tx, rx) = tokio::sync::watch::channel(Status::default()); + let (tx, rx) = channel(Status::Error(None)); let handle = tokio::spawn(service.spawn(tx)); Self { handle, rx } } -- cgit v1.2.3-70-g09d2