Created
January 1, 2012 00:35
-
-
Save JakeAustwick/1545770 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Individual SQL statement take too long, one insert is by far the fastest | |
connection = ActiveRecord::Base.connection | |
#This is in a looop | |
results.push "(#{resp.response_header.status}, #{url[0]}, #{status_code(resp.response_header.status)}, \"#{resp.response_header}\")" | |
sql = "INSERT INTO reports (`code`, `site_id`, `status`, `headers`) VALUES #{results.join(", ")}" | |
connection.execute sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment