From 3920fb8354c14acc55afc60f38774ff124ee8687 Mon Sep 17 00:00:00 2001 From: lucacug Date: Sat, 12 Jun 2021 14:59:49 +0100 Subject: [PATCH] change csv delimiter to pipe and make sure query is resetted on each requests for full trade db export --- lib/tasks/export_trade_db.rake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/tasks/export_trade_db.rake b/lib/tasks/export_trade_db.rake index 5f94c5fbc1..e51b0e7aca 100644 --- a/lib/tasks/export_trade_db.rake +++ b/lib/tasks/export_trade_db.rake @@ -181,6 +181,7 @@ namespace :export do } process_results(results, options) offset = offset + RECORDS_PER_FILE + query = nil end Rails.logger.info("Trade database completely exported!") zipfile = 'tmp/trade_db_files/trade_db.zip' @@ -222,10 +223,10 @@ namespace :export do end Rails.logger.info("Processing #{filename}.") File.open("#{options[:dir]}#{filename}", 'w') do |file| - file.write columns.join(',') + file.write columns.join('|') values.each do |record| file.write "\n" - file.write record.join(',') + file.write record.join('|') end end end