Skip to content

Commit b5e230a

Browse files
CodingAnarchyclaude
andcommitted
fix: Resolve type conflicts and test imports for v1.15.1 release
- Fix Result type conflicts in migration runners by using std::result::Result - Add missing imports to test files (Arc, JobQueue, Duration, etc.) - Fix worker_batch_tests.rs imports for proper compilation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 6efd57a commit b5e230a

File tree

15 files changed

+389
-263
lines changed

15 files changed

+389
-263
lines changed

hammerwork-web/src/api/archive.rs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,15 @@ where
405405
let total = if jobs.len() as u64 == pagination.limit {
406406
// If we got exactly the limit, there might be more records
407407
// Run another query to get a better count estimate
408-
match queue.list_archived_jobs(filters.queue.as_deref(), Some(10000), Some(0), filters.older_than).await {
408+
match queue
409+
.list_archived_jobs(
410+
filters.queue.as_deref(),
411+
Some(10000),
412+
Some(0),
413+
filters.older_than,
414+
)
415+
.await
416+
{
409417
Ok(all_jobs) => all_jobs.len() as u64,
410418
Err(_) => jobs.len() as u64, // Fallback to current page count
411419
}
@@ -474,11 +482,14 @@ where
474482
if request.dry_run {
475483
// For dry run, estimate how many jobs would be purged by using list_archived_jobs
476484
// with a large limit to get an accurate count
477-
let count = match queue.list_archived_jobs(None, Some(10000), Some(0), request.older_than).await {
485+
let count = match queue
486+
.list_archived_jobs(None, Some(10000), Some(0), request.older_than)
487+
.await
488+
{
478489
Ok(jobs) => jobs.len() as u64,
479490
Err(_) => 0, // If we can't get the count, return 0 for safety
480491
};
481-
492+
482493
let response = PurgeResponse {
483494
jobs_purged: count,
484495
dry_run: true,
@@ -515,18 +526,20 @@ where
515526
Ok(stats) => {
516527
// Collect per-queue stats if no specific queue is filtered
517528
let mut by_queue = std::collections::HashMap::new();
518-
529+
519530
if filters.queue.is_none() {
520531
// Get queue list and collect stats for each
521532
if let Ok(queue_stats) = queue.get_all_queue_stats().await {
522533
for queue_stat in queue_stats {
523-
if let Ok(queue_archival_stats) = queue.get_archival_stats(Some(&queue_stat.queue_name)).await {
534+
if let Ok(queue_archival_stats) =
535+
queue.get_archival_stats(Some(&queue_stat.queue_name)).await
536+
{
524537
by_queue.insert(queue_stat.queue_name, queue_archival_stats);
525538
}
526539
}
527540
}
528541
}
529-
542+
530543
// Generate some mock recent operations (in a real implementation, these would be tracked)
531544
let recent_operations = vec![
532545
RecentOperation {

0 commit comments

Comments
 (0)