1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

B #5460: onedb purge-size check seq number

(cherry picked from commit 23fe16454e700c4df1172130139b94bec435d7ed)
This commit is contained in:
Javi Fontan 2017-10-17 16:15:34 +02:00 committed by Ruben S. Montero
parent bbdbeedaae
commit 34db8f3b4e

View File

@ -147,7 +147,10 @@ class OneDBLive
history_num = 2
if Array === val_history && val_history.size > history_num
val_history = [val_history].flatten
last_seq = val_history.last['SEQ'].to_i rescue 0
if last_seq >= history_num
last_history = val_history.last(history_num)
old_seq = []
@ -178,6 +181,8 @@ class OneDBLive
# Renumerate sequence numbers
old_seq.each_with_index do |seq, index|
row = history.find {|r| seq.to_s == r["seq"] }
next if !row
body = Base64.decode64(row['body64'])
doc = Nokogiri::XML(body)