From aaf2c90af6a159122822854d4625ea5c16c11c16 Mon Sep 17 00:00:00 2001 From: Avril Date: Tue, 15 Sep 2020 07:59:28 +0100 Subject: [PATCH] removed worker host --- src/state/local/mod.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/state/local/mod.rs b/src/state/local/mod.rs index c99e27a..a117a7d 100644 --- a/src/state/local/mod.rs +++ b/src/state/local/mod.rs @@ -37,7 +37,7 @@ pub struct Imouto title: Option, karada: Karada, - worker: Worker, + worker: Kokoro, timestamp: post::PostTimestamp, //Note that `closed` should always be `None` in `Imouto`. We use this for post lifetimes and such } @@ -56,11 +56,7 @@ impl Suspendable for Imouto output.insert("id", self.id); output.insert("user", self.user); output.insert("title", self.title); - output.insert("body", match self.worker { - Worker::Suspended(kokoro) => kokoro.into_suspended().await, // consume worker if possible - Worker::Attached(_) => self.karada.into_suspended().await, // consume body instead - _ => return Err(suspend::Error::Other(eyre::eyre!("Tried to suspend crashed worker"))), - }); + output.insert("body", self.worker.into_suspended().await); // consume worker if possible //output.insert("hash", self.hash); output.insert("timestamp", self.timestamp); into.set_object(output).await @@ -82,7 +78,7 @@ impl Suspendable for Imouto let (karada, worker) = { let mut kokoro = Kokoro::from_suspended(body); - (kokoro.spawn().unwrap(), Worker::Suspended(kokoro)) + (kokoro.spawn().unwrap(), kokoro) }; Ok(Self { id,