This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 14ed0f88 Add connect timeout and some progress messages
14ed0f88 is described below
commit 14ed0f889139470625872b6096e37ca349ec4a0a
Author: Sebb <[email protected]>
AuthorDate: Tue Jun 24 23:36:58 2025 +0100
Add connect timeout and some progress messages
---
tools/pubsub.rb | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/pubsub.rb b/tools/pubsub.rb
index d486b205..576d80a5 100644
--- a/tools/pubsub.rb
+++ b/tools/pubsub.rb
@@ -147,7 +147,7 @@ ps_thread = Thread.new do
begin
uri = URI.parse(options.streamURL)
- Net::HTTP.start(uri.host, uri.port) do |http|
+ Net::HTTP.start(uri.host, uri.port, :open_timeout => 30) do |http|
request = Net::HTTP::Get.new uri.request_uri
http.request request do |response|
@@ -185,6 +185,7 @@ ps_thread = Thread.new do
STDERR.puts stamp e
STDERR.puts stamp e.backtrace
end
+ puts stamp 'Thread ended'
end
#
@@ -196,6 +197,7 @@ begin
while ps_thread.alive?
notification = notification_queue.pop
next unless notification['project'] == PROJECT
+ puts stamp 'Detected notification for our project'
notification_queue.clear
if options.puppet
@@ -220,6 +222,7 @@ begin
sleep 30 * (i+1)
end
else
+ puts stamp 'Update git in foreground'
# update git directories in the foreground
Dir.chdir(options.local) do
before = `git log --oneline -1`
@@ -232,10 +235,11 @@ begin
end
end
if mtime != File.mtime(__FILE__) # we have been updated
- STDERR.puts stamp 'Detected self update'
+ puts stamp 'Detected self update'
break
end
end
+ puts stamp 'Thread ended'
rescue SignalException => e
STDERR.puts stamp e.inspect
restartable = false