From 2fd40515d12d8a4b61d0ad828a8a61a768a7f68c Mon Sep 17 00:00:00 2001 From: LubyRuffy Date: Thu, 23 Oct 2014 17:35:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=B9=E9=87=8F=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=92=8C=E7=AE=A1=E9=81=93=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/dump_all_query.rb | 2 ++ tools/query_processors/shownews_has_comment.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/dump_all_query.rb b/tools/dump_all_query.rb index 35671bd..7956d31 100755 --- a/tools/dump_all_query.rb +++ b/tools/dump_all_query.rb @@ -1,4 +1,6 @@ #!/usr/bin/env ruby +# 加入管道: +# RAILS_ENV=production ./dump_all_query.rb 'body="shownews.asp?id"' | ./query_processors/shownews_has_comment.rb require 'yaml' require 'json' require 'erb' diff --git a/tools/query_processors/shownews_has_comment.rb b/tools/query_processors/shownews_has_comment.rb index 11483ec..b2d3d75 100755 --- a/tools/query_processors/shownews_has_comment.rb +++ b/tools/query_processors/shownews_has_comment.rb @@ -2,7 +2,7 @@ require 'thread/pool' require 'net/http' -pool = Thread.pool(1) +pool = Thread.pool(100) while (s = $stdin.gets) pool.process(s.strip) {|h|