crono_trigger 0.3.0 → 0.3.2

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
- SHA1:
3
- metadata.gz: 9fab2315a80e4be9236cf9434376391a1c6094db
4
- data.tar.gz: 81c83e45ab1dc7807da2aa37b32ae7a2eae29be2
2
+ SHA256:
3
+ metadata.gz: 8d12624dcc2f27a3f0bc7c83544ae735490c8d4294587fe6fce6b16661d934c1
4
+ data.tar.gz: 931bd6e1dcba7a0a77f644235d74f762f3587e65b17a36a1bb9bf962b8e27a9e
5
5
  SHA512:
6
- metadata.gz: 70ae8e8e74eb754c58276dd009ba7b186039f47bbf06271040e274e1c7f636048a90bf6583aea7541b961e001ccb1a898583de320415afc69d3abfb29bcfb15c
7
- data.tar.gz: a98c18cd51895f6cdfc190988cd66990b405875b8daec137f74e51d4f72d4caac643b5622adf7fdc14b8544840254a916b0a88624fd4c454cf3004bb75ae7619
6
+ metadata.gz: aee050331778f7db89628d332efc7c4cfe7965dc2a8b19f6bd1eaa678045f5fe5b64042ba3b7511bee542f9b310debdd65728694e2c4f07b94bd1c362a80370a
7
+ data.tar.gz: ef25f44ecdc3afc9dab964ffa9d82ff455d02fe26d96614951df75b764a9067cbc177083bbbb4f39071e6d3208a99cd924613b04b26866d09506eb56f8360d9e
data/.travis.yml CHANGED
@@ -2,9 +2,14 @@ sudo: false
2
2
  language: ruby
3
3
  cache: bundler
4
4
  rvm:
5
- - 2.4.1
6
- - 2.3.3
5
+ - 2.5.0
6
+ - 2.4.3
7
7
  gemfile:
8
- - gemfiles/activerecord-42.gemfile
9
8
  - gemfiles/activerecord-50.gemfile
10
9
  - gemfiles/activerecord-51.gemfile
10
+ - gemfiles/activerecord-52.gemfile
11
+ before_install:
12
+ - mysql -e 'CREATE DATABASE IF NOT EXISTS test;'
13
+ env:
14
+ - DB=sqlite
15
+ - DB=mysql MYSQL_RESTART_COMMAND="sudo service mysql restart"
@@ -29,6 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.add_dependency "activerecord", ">= 4.2"
30
30
 
31
31
  spec.add_development_dependency "sqlite3"
32
+ spec.add_development_dependency "mysql2"
32
33
  spec.add_development_dependency "timecop"
33
34
  spec.add_development_dependency "rollbar"
34
35
  spec.add_development_dependency "bundler", "~> 1.14"
@@ -1,5 +1,5 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- gem "activerecord", "~> 4.2.0"
3
+ gem "activerecord", "~> 5.1.0"
4
4
 
5
5
  gemspec :path => "../"
@@ -34,12 +34,9 @@ module CronoTrigger
34
34
  records = []
35
35
  primary_key_offset = nil
36
36
  begin
37
- begin
38
- conn = model.connection_pool.checkout
37
+ model.connection_pool.with_connection do
39
38
  records = model.executables_with_lock(primary_key_offset: primary_key_offset)
40
39
  primary_key_offset = records.last && records.last.id
41
- ensure
42
- model.connection_pool.checkin(conn)
43
40
  end
44
41
 
45
42
  records.each do |record|
@@ -33,7 +33,7 @@ module CronoTrigger
33
33
  rel = rel.where(t[crono_trigger_column_name(:finished_at)].gt(from).or(t[crono_trigger_column_name(:finished_at)].eq(nil))) if column_names.include?(crono_trigger_column_name(:finished_at))
34
34
  rel = rel.where(t[primary_key].gt(primary_key_offset)) if primary_key_offset
35
35
 
36
- rel = rel.order("#{quoted_table_name}.#{quoted_primary_key} ASC").limit(limit)
36
+ rel = rel.order(Arel.sql("#{quoted_table_name}.#{quoted_primary_key} ASC")).limit(limit)
37
37
 
38
38
  rel = executable_conditions.reduce(rel) do |merged, pr|
39
39
  if pr.arity == 0
@@ -1,3 +1,3 @@
1
1
  module CronoTrigger
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crono_trigger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - joker1007
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-29 00:00:00.000000000 Z
11
+ date: 2018-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chrono
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: mysql2
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: timecop
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -198,9 +212,9 @@ files:
198
212
  - bin/setup
199
213
  - crono_trigger.gemspec
200
214
  - exe/crono_trigger
201
- - gemfiles/activerecord-42.gemfile
202
215
  - gemfiles/activerecord-50.gemfile
203
216
  - gemfiles/activerecord-51.gemfile
217
+ - gemfiles/activerecord-52.gemfile
204
218
  - lib/crono_trigger.rb
205
219
  - lib/crono_trigger/cli.rb
206
220
  - lib/crono_trigger/exception_handler.rb
@@ -236,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
236
250
  version: '0'
237
251
  requirements: []
238
252
  rubyforge_project:
239
- rubygems_version: 2.6.13
253
+ rubygems_version: 2.7.4
240
254
  signing_key:
241
255
  specification_version: 4
242
256
  summary: In Service Asynchronous Job Scheduler for Rails