Skip to content

Commit e495b81

Browse files
committed
updated readme file
1 parent 060b5ec commit e495b81

3 files changed

Lines changed: 107 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Changelog
22

3+
## [0.3.2] - 2025-06-12
4+
5+
### Added
6+
7+
- Added reject functionality for scheduled jobs with bulk operations support
8+
- New "Reject Selected" button in scheduled jobs view alongside "Execute Selected"
9+
- Added `RejectJobService` for handling job rejection logic
10+
- Added confirmation dialog for reject operations to prevent accidental job cancellation
11+
- Added `POST /reject_jobs` route for bulk rejection operations
12+
13+
### Improved
14+
15+
- Enhanced scheduled jobs UI with dual action buttons (Execute/Reject)
16+
- Improved JavaScript form handling to prevent duplicate job ID submissions
17+
- Added proper error handling and success messaging for reject operations
18+
- Optimized button state management for better user experience
19+
20+
### Fixed
21+
22+
- Fixed duplicate job ID issue in form submissions for bulk operations
23+
- Corrected JavaScript form submission logic to prevent parameter duplication
24+
325
## [0.3.1] - 2024-03-28
426

527
### Improved

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ A lightweight, zero-dependency web interface for monitoring Solid Queue backgrou
1818
- **Dashboard Overview**: Get a quick snapshot of your queue's health with statistics on all job types
1919
- **Ready Jobs**: View jobs that are ready to be executed
2020
- **In Progress Jobs**: Monitor jobs currently being processed by workers
21-
- **Scheduled Jobs**: See upcoming jobs scheduled for future execution
21+
- **Scheduled Jobs**: See upcoming jobs scheduled for future execution with ability to execute immediately or reject permanently
2222
- **Recurring Jobs**: Manage periodic jobs that run on a schedule
2323
- **Failed Jobs**: Track and debug failed jobs, with the ability to retry or discard them
2424
- **Queue Management**: View and filter jobs by queue
2525
- **Advanced Job Filtering**: Filter jobs by class name, queue, status, and job arguments
26-
- **Quick Actions**: Retry or discard failed jobs directly from any view
26+
- **Quick Actions**: Retry or discard failed jobs, execute or reject scheduled jobs directly from any view
2727
- **Performance Optimized**: Designed for high-volume applications with smart pagination
2828
- **Optional Authentication**: Secure your dashboard with HTTP Basic Authentication
2929
- **Responsive Design**: Works on desktop and mobile devices
@@ -44,7 +44,7 @@ A lightweight, zero-dependency web interface for monitoring Solid Queue backgrou
4444
Add this line to your application's Gemfile:
4545

4646
```ruby
47-
gem 'solid_queue_monitor', '~> 0.3.1'
47+
gem 'solid_queue_monitor', '~> 0.3.2'
4848
```
4949

5050
Then execute:
@@ -103,9 +103,9 @@ The dashboard provides several views:
103103

104104
- **Overview**: Shows statistics and recent jobs
105105
- **Ready Jobs**: Jobs that are ready to be executed
106-
- **Scheduled Jobs**: Jobs scheduled for future execution
106+
- **Scheduled Jobs**: Jobs scheduled for future execution with execute and reject actions
107107
- **Recurring Jobs**: Jobs that run on a recurring schedule
108-
- **Failed Jobs**: Jobs that have failed with error details
108+
- **Failed Jobs**: Jobs that have failed with error details and retry/discard actions
109109
- **Queues**: Distribution of jobs across different queues
110110

111111
### API-only Applications
@@ -127,7 +127,7 @@ This makes it easy to find specific jobs when debugging issues in your applicati
127127

128128
- **Production Monitoring**: Keep an eye on your background job processing in production environments
129129
- **Debugging**: Quickly identify and troubleshoot failed jobs
130-
- **Job Management**: Execute scheduled jobs on demand when needed
130+
- **Job Management**: Execute scheduled jobs on demand or reject unwanted jobs permanently
131131
- **Performance Analysis**: Track job distribution and identify bottlenecks
132132
- **DevOps Integration**: Easily integrate with your monitoring stack
133133

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# frozen_string_literal: true
2+
3+
require 'spec_helper'
4+
5+
RSpec.describe SolidQueueMonitor::RejectJobService do
6+
describe '#reject_many' do
7+
subject { described_class.new }
8+
9+
let!(:scheduled_execution1) { create(:solid_queue_scheduled_execution) }
10+
let!(:scheduled_execution2) { create(:solid_queue_scheduled_execution) }
11+
12+
it 'rejects scheduled jobs and marks them as finished' do
13+
expect do
14+
result = subject.reject_many([scheduled_execution1.id, scheduled_execution2.id])
15+
expect(result[:success]).to be true
16+
end.to change(SolidQueue::ScheduledExecution, :count).by(-2)
17+
end
18+
19+
it 'marks associated jobs as finished when rejecting' do
20+
subject.reject_many([scheduled_execution1.id])
21+
22+
job = scheduled_execution1.job.reload
23+
expect(job.finished_at).to be_present
24+
end
25+
26+
it 'returns success message when all jobs are rejected successfully' do
27+
result = subject.reject_many([scheduled_execution1.id, scheduled_execution2.id])
28+
29+
expect(result[:success]).to be true
30+
expect(result[:message]).to eq('All selected jobs have been rejected')
31+
end
32+
33+
it 'handles non-existent job IDs gracefully' do
34+
result = subject.reject_many([999_999])
35+
36+
expect(result[:success]).to be false
37+
expect(result[:message]).to eq('Failed to reject jobs')
38+
end
39+
40+
it 'handles empty job IDs array gracefully' do
41+
result = subject.reject_many([])
42+
43+
expect(result[:success]).to be false
44+
expect(result[:message]).to eq('No jobs selected')
45+
end
46+
47+
it 'handles mix of valid and invalid job IDs' do
48+
result = subject.reject_many([scheduled_execution1.id, 999_999])
49+
50+
expect(result[:success]).to be true
51+
expect(result[:message]).to include('1 jobs rejected, 1 failed')
52+
end
53+
54+
it 'removes scheduled execution from database' do
55+
subject.reject_many([scheduled_execution1.id])
56+
57+
expect(SolidQueue::ScheduledExecution.find_by(id: scheduled_execution1.id)).to be_nil
58+
end
59+
end
60+
61+
describe '#call' do
62+
subject { described_class.new }
63+
64+
let!(:scheduled_execution) { create(:solid_queue_scheduled_execution) }
65+
66+
it 'rejects a single scheduled job' do
67+
expect do
68+
subject.call(scheduled_execution.id)
69+
end.to change(SolidQueue::ScheduledExecution, :count).by(-1)
70+
end
71+
72+
it 'marks the job as finished' do
73+
subject.call(scheduled_execution.id)
74+
75+
job = scheduled_execution.job.reload
76+
expect(job.finished_at).to be_present
77+
end
78+
end
79+
end

0 commit comments

Comments
 (0)