web47core 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 862ce506f9e7921057f3cb89f87c9adc51d66880f0892af68bf5cd431f60776f
|
4
|
+
data.tar.gz: ba0e7a0c12e80eb580eb0e4ba220b718a5b044665003e59a9c5eb33c032b7a9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0ed82a52e27ddbb93dba4a2cb2970a9171aa815043e68c5ec7eb6251c045ccdb8f1c2b4e187a3635cab09784e45b58f718e752800e62b24c27aba3db5c5bb9d
|
7
|
+
data.tar.gz: a839df6e9d4247884a4f37c66e1f18322c59537cc7d03ab33bcc04263ba990eea06ece2b55676e7032e16192033e3edf208ccaa48e7b2f782990094fbdaa184c
|
@@ -10,7 +10,7 @@ module CoreDelayedJobsController
|
|
10
10
|
#
|
11
11
|
def index
|
12
12
|
authorize! :read, Delayed::Backend::Mongoid::Job
|
13
|
-
|
13
|
+
delayed_jobs
|
14
14
|
end
|
15
15
|
|
16
16
|
def show
|
@@ -23,7 +23,7 @@ module CoreDelayedJobsController
|
|
23
23
|
def destroy_all
|
24
24
|
authorize! :manage, Delayed::Backend::Mongoid::Job
|
25
25
|
failed_only = params[:failed_only].eql?('true')
|
26
|
-
|
26
|
+
delayed_jobs.each do |job|
|
27
27
|
next if failed_only && !job.failed?
|
28
28
|
|
29
29
|
job.destroy
|
@@ -41,7 +41,7 @@ module CoreDelayedJobsController
|
|
41
41
|
def resubmit_all
|
42
42
|
authorize! :read, Delayed::Backend::Mongoid::Job
|
43
43
|
failed_only = params[:failed_only].eql?('true')
|
44
|
-
|
44
|
+
delayed_jobs.each do |job|
|
45
45
|
next if failed_only && !job.failed?
|
46
46
|
|
47
47
|
job.resubmit
|
@@ -79,9 +79,28 @@ module CoreDelayedJobsController
|
|
79
79
|
redirect_to index_path
|
80
80
|
end
|
81
81
|
|
82
|
-
|
83
|
-
|
82
|
+
#
|
83
|
+
# Fetch the required job by id
|
84
|
+
#
|
84
85
|
def delayed_job
|
85
86
|
@delayed_job ||= Delayed::Backend::Mongoid::Job.find(params[:id])
|
86
87
|
end
|
88
|
+
|
89
|
+
#
|
90
|
+
# Find the first jobs for index or deleting all
|
91
|
+
#
|
92
|
+
def delayed_jobs
|
93
|
+
@delayed_jobs ||= Delayed::Backend::Mongoid::Job.
|
94
|
+
order_by(locked_by: :desc, priority: :asc, run_at: :asc).
|
95
|
+
limit(delayed_jobs_limit)
|
96
|
+
end
|
97
|
+
|
98
|
+
#
|
99
|
+
# Define the limit of jobs to fetch for the index of delete all/resubmit all
|
100
|
+
#
|
101
|
+
# Override this in your project if you want a different limit
|
102
|
+
#
|
103
|
+
def delayed_jobs_limit
|
104
|
+
100
|
105
|
+
end
|
87
106
|
end
|
data/lib/web47core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web47core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Schroeder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|