Skip to content

Commit

Permalink
added unbind to EM::Connection
Browse files Browse the repository at this point in the history
  • Loading branch information
John Tajima committed Jul 29, 2009
1 parent f87c6dc commit 794aea9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
12 changes: 3 additions & 9 deletions server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def build_grep_request(params)
cmd << query_filter(queries.shift)
end
cmd.strip
%[sh -c 'sleep 60; sleep 70; #{cmd}']
%[sh -c '#{cmd}']
end

def query_filter(query)
Expand All @@ -128,16 +128,10 @@ def sanitize_query(query_string)
query = Regexp.escape(query_string).gsub(/'/, "").gsub(/"/, "")
end

def unbind

def unbind
if @grepper
@grepper.unbind
# pid = @grepper.get_status.pid
# ppid = Process.getpgid(pid)
# puts " #{pid} group id #{ppid}"
# Process.kill('HUP', ppid) if ppid
close_connection
puts 'Closing'
puts 'UNBIND'
else
puts 'nothing to close'
end
Expand Down
2 changes: 1 addition & 1 deletion views/error.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<body>
<div id='header' style="width:auto; height: 50px; padding: 10px; border-bottom: 1px solid #ddd; margin: -5px -10px 10px; background: #f0f0f0;">
<h3>Log Search Server</h3>
<h3><a href='/'>Log Search Server</a></h3>
<form id="search" action="/search" method="get">
<input type="hidden" name="hl" value="en" />
Log file:
Expand Down
2 changes: 1 addition & 1 deletion views/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</head>
<body>
<div id='header' style="width:auto; height: 50px; padding: 10px; border-bottom: 1px solid #ddd; margin: -5px -10px 10px; background: #f0f0f0;">
<h3>Log Search Server</h3>
<h3><a href='/'>Log Search Server</a></h3>
<form id="search" action="/search" method="get">
<input type="hidden" name="hl" value="en" />
Log file:
Expand Down
2 changes: 1 addition & 1 deletion views/results.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</head>
<body>
<div id='header' style="width:auto; height: 50px; padding: 10px; border-bottom: 1px solid #ddd; margin: -5px -10px 10px; background: #f0f0f0;">
<h3>Log Search Server</h3>
<h3><a href='/'>Log Search Server</a></h3>
<form id="search" action="/search" method="get">
<input type="hidden" name="hl" value="en" />
Log file:
Expand Down

0 comments on commit 794aea9

Please sign in to comment.