cuetip 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cuetip/job.rb +7 -0
- data/lib/cuetip/models/job.rb +1 -1
- data/lib/cuetip/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb9bb24e692fd6dd36474dacfbce871a57e5fbf89e76751c14e3800d94edf4c6
|
4
|
+
data.tar.gz: e02635ecc69e6ac817259f876f87b48cf188452fc9a4869cb76c2edd2be874f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 528e2243bdfd1fc770d3009d6fa1b04682a27e6fca021b2a114ee28d501c94f5647b89be5f3117ab3f1d634d4598f9719d9af28bc1ac19bcd5ed4d98d6ed027f
|
7
|
+
data.tar.gz: 3899852d6e2c92f23f2abff21a51c2c70329abb99b49e3da446f8e74c9614f6090d74c4f9e20b5c03378fcc937e2d9565e903a0b2cac820d3410c18bbfbfd25c
|
data/lib/cuetip/job.rb
CHANGED
@@ -62,6 +62,13 @@ module Cuetip
|
|
62
62
|
# Return the job
|
63
63
|
job
|
64
64
|
end
|
65
|
+
|
66
|
+
# Prune jobs before a specific time
|
67
|
+
#
|
68
|
+
# @param before [ActiveSupport::TimeWithZone] The point in time to prune jobs until.
|
69
|
+
def prune(before)
|
70
|
+
Models::Job.where('created_at < ?', before).destroy_all
|
71
|
+
end
|
65
72
|
end
|
66
73
|
|
67
74
|
# Initialize this job instance by providing a queued job instance
|
data/lib/cuetip/models/job.rb
CHANGED
@@ -11,7 +11,7 @@ module Cuetip
|
|
11
11
|
|
12
12
|
STATUSES = %w[Pending Running Complete Aborted Expired].freeze
|
13
13
|
|
14
|
-
has_one :queued_job, class_name: 'Cuetip::Models::QueuedJob'
|
14
|
+
has_one :queued_job, class_name: 'Cuetip::Models::QueuedJob', dependent: :destroy
|
15
15
|
belongs_to :associated_object, polymorphic: true, optional: true
|
16
16
|
|
17
17
|
serialize :params, Cuetip::SerializedHashie
|
data/lib/cuetip/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cuetip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|