feat(enhance): discard, tests against a mock ComfyUI, docs (#192)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3a21761cfe
commit
97d9301a71
10 files changed
+1165
-48
No files matched your search
@@ -93,8 +93,11 @@ pub trait EnhanceJobDao: Sync + Send {
|
||||
fn insert(&mut self, job: &EnhanceJobRow) -> Result<(), DbError>;
|
||||
fn get(&mut self, id: &str) -> Result<Option<EnhanceJobRow>, DbError>;
|
||||
/// Newest first.
|
||||
fn list_for_hash(&mut self, original_hash: &str, limit: i64)
|
||||
-> Result<Vec<EnhanceJobRow>, DbError>;
|
||||
fn list_for_hash(
|
||||
&mut self,
|
||||
original_hash: &str,
|
||||
limit: i64,
|
||||
) -> Result<Vec<EnhanceJobRow>, DbError>;
|
||||
/// Jobs the poller still has to advance (`queued` / `running`).
|
||||
fn list_active(&mut self) -> Result<Vec<EnhanceJobRow>, DbError>;
|
||||
fn update(&mut self, id: &str, update: &JobUpdate) -> Result<(), DbError>;
|
||||
@@ -325,7 +328,11 @@ mod tests {
|
||||
assert!(a.updated_at >= 100);
|
||||
|
||||
d.discard("b").unwrap();
|
||||
assert_eq!(d.list_for_hash("h1", 10).unwrap().len(), 1, "discarded hidden");
|
||||
assert_eq!(
|
||||
d.list_for_hash("h1", 10).unwrap().len(),
|
||||
1,
|
||||
"discarded hidden"
|
||||
);
|
||||
|
||||
// Prune drops only old, finished jobs (updated_at was just bumped
|
||||
// for `a`; `c` is active).
|
||||
|
||||
Reference in new issue
Block a user