Skip to content

Commit

Permalink
change csv delimiter to pipe and make sure query is resetted on each …
Browse files Browse the repository at this point in the history
…requests for full trade db export
  • Loading branch information
lucacug committed Jun 12, 2021
1 parent 99f85a0 commit 3920fb8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/tasks/export_trade_db.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3920fb8

Please sign in to comment.