Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge "add success_num for postgresql insert data action"

  • Loading branch information...
commit 8f528d4cc01f0efe425942b5bf722df84ffdd68d 2 parents 74a9306 + d301ec7
michael zhang authored Gerrit Code Review committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 sinatra/app_sinatra_service_quota/main.rb
4 sinatra/app_sinatra_service_quota/main.rb
View
@@ -274,12 +274,12 @@
# populate data into postgresql table
post '/service/postgresql/tables/:name/:megabytes' do
client = load_postgresql
+ i = 0
begin
content = prepare_data(1)
client = load_postgresql
sleep 1
size = params[:megabytes].to_i
- i = 0
while i < size do
client.query("insert into #{params[:name]} (value) values('#{content}');")
sleep 1 if i % 10 == 0
@@ -287,7 +287,7 @@
end
'ok'
rescue => e
- "#{e}"
+ "#{i}-#{e}"
ensure
client.close if client
end
Please sign in to comment.
Something went wrong with that request. Please try again.