rufus-scheduler 3.1.1 → 3.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.txt CHANGED
@@ -2,6 +2,11 @@
2
2
  = rufus-scheduler CHANGELOG.txt
3
3
 
4
4
 
5
+ == rufus-scheduler - 3.1.2 released 2015/05/23
6
+
7
+ - avoid cron/:first_at infinite loop, thanks https://github.com/pouellet
8
+
9
+
5
10
  == rufus-scheduler - 3.1.1 released 2015/04/19
6
11
 
7
12
  - fix ZoTime.is_timezone? on OSX, thanks https://github.com/yaauie
data/CREDITS.txt CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  == Contributors
6
6
 
7
+ - Pascal Ouellet (https://github.com/pouellet) Scheduler#timeline loop fix
7
8
  - Ryan Biesemeyer (https://github.com/yaauie) ZoTime.is_timezone? on OSX
8
9
  - Ketan Padegaonkar (https://github.com/ketan) .brute_frequency improvement
9
10
  - Gabriel Gilder (https://github.com/ggilder) LA DST specs
@@ -39,7 +39,7 @@ module Rufus
39
39
  require 'rufus/scheduler/job_array'
40
40
  require 'rufus/scheduler/locks'
41
41
 
42
- VERSION = '3.1.1'
42
+ VERSION = '3.1.2'
43
43
 
44
44
  #
45
45
  # A common error class for rufus-scheduler
@@ -621,7 +621,7 @@ module Rufus
621
621
 
622
622
  def next_time_from(time)
623
623
 
624
- if @first_at == nil || @first_at < time
624
+ if @first_at == nil || @first_at <= time
625
625
  @cron_line.next_time(time)
626
626
  else
627
627
  @first_at
@@ -611,7 +611,7 @@ describe Rufus::Scheduler do
611
611
  end
612
612
  end
613
613
 
614
- describe '#timeline(time0, time1)' do
614
+ describe '#timeline' do
615
615
 
616
616
  it 'returns a [ [ time, job ], ... ] of job occurrences' do
617
617
 
@@ -625,6 +625,21 @@ describe Rufus::Scheduler do
625
625
  expect(a[1][0]).to be_within_1s_of(Time.now + 10 * 60)
626
626
  expect(a[1][1]).to eq(j1)
627
627
  end
628
+
629
+ it 'should not lock when running timeline with a :first_at specified' do
630
+
631
+ now = Time.now
632
+
633
+ # scheduling a cron job with a first_at and running #timeline used
634
+ # to result in an infinite loop.
635
+
636
+ @scheduler.cron('* * * * * *', :first_at => now + 3) {}
637
+
638
+ jobs = @scheduler.timeline(now, now + 4)
639
+ expect(jobs.size).to be 2
640
+ expect(jobs[0][0]).to be_within_1s_of now + 3
641
+ expect(jobs[1][0]).to be_within_1s_of now + 4
642
+ end
628
643
  end
629
644
 
630
645
  #--
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rufus-scheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-04-18 00:00:00.000000000 Z
12
+ date: 2015-05-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake