Safety check before using row values.
FossilOrigin-Name: 762164d99717433a03474f5e927c58540f5a2863404e3c69f8f83fd04cad624f
This commit is contained in:
parent
7c2954b0ad
commit
649332a422
2 changed files with 8 additions and 9 deletions
|
|
@ -180,8 +180,12 @@ class Symphony::Metronome::ScheduledEvent
|
|||
#
|
||||
if self.event.recurring
|
||||
now = Time.now
|
||||
last = self.ds.first[ :lastrun ]
|
||||
row = self.ds.first
|
||||
|
||||
if row
|
||||
last = row[ :lastrun ]
|
||||
return false if last && now - last < self.event.interval
|
||||
end
|
||||
|
||||
# Mark the time this recurring event was fired.
|
||||
self.ds.update( :lastrun => Time.now )
|
||||
|
|
|
|||
|
|
@ -9,11 +9,6 @@ describe Symphony::Metronome::Scheduler do
|
|||
described_class.configure
|
||||
end
|
||||
|
||||
it 'spins up an AMQP listener by default' do
|
||||
|
||||
# described_class.run {}
|
||||
# expect( described_class.listen ).to eq( :sd )
|
||||
|
||||
end
|
||||
# needs tests
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue