mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 07:38:01 +08:00
FIX: make report data export more resilient to inconsistent date format
The DAU/MAU report export was failing because of date being a string and not a valid Date value
This commit is contained in:
parent
54a9073d94
commit
cafd1241b9
|
@ -183,11 +183,11 @@ module Jobs
|
|||
|
||||
report_hash = {}
|
||||
Report.find(@extra[:name], @extra).data.each do |row|
|
||||
report_hash[row[:x].to_s(:db)] = row[:y].to_s(:db)
|
||||
report_hash[row[:x].to_s] = row[:y].to_s
|
||||
end
|
||||
|
||||
(@extra[:start_date].to_date..@extra[:end_date].to_date).each do |date|
|
||||
yield [date.to_s(:db), report_hash.fetch(date.to_s(:db), 0)]
|
||||
yield [date.to_s(:db), report_hash.fetch(date.to_s, 0)]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user