summaryrefslogtreecommitdiffstats
path: root/src/http/sse.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/sse.rs')
-rw-r--r--src/http/sse.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/http/sse.rs b/src/http/sse.rs
index e141926..5bfb75b 100644
--- a/src/http/sse.rs
+++ b/src/http/sse.rs
@@ -15,7 +15,6 @@ use std::path::{Path, PathBuf};
use std::time::{Duration, Instant};
use crate::db::builds;
-use crate::db::model::build_state;
/// How long a tail will wait for a build that never finishes. A viewer that
/// outlives this gets a clean end and can reconnect.
@@ -53,10 +52,7 @@ impl LogTail {
fn terminal(&self) -> bool {
match builds::get(&self.db, &self.build_id) {
- Ok(Some(b)) => matches!(
- b.state.as_str(),
- build_state::SUCCEEDED | build_state::FAILED | build_state::CANCELLED
- ),
+ Ok(Some(b)) => b.state.is_terminal(),
// A build row that vanished is not going to produce more output.
Ok(None) => true,
// A database hiccup should not end the stream; the next poll tries