1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2025-12-01 05:43:04 +00:00

fix: fixes potential issue if machine hostname cannot be determined

هذا الالتزام موجود في:
Adam Cooke
2024-02-24 11:03:04 +00:00
الأصل 2e7b36c1be
التزام 0fcf778a51

عرض الملف

@@ -26,7 +26,7 @@ class HealthServer
private
def root
[200, { "Content-Type" => "text/plain" }, ["#{@name} (pid: #{Process.pid}, host: #{Socket.gethostname})"]]
[200, { "Content-Type" => "text/plain" }, ["#{@name} (pid: #{Process.pid}, host: #{hostname})"]]
end
def ok
@@ -43,6 +43,12 @@ class HealthServer
[200, { "Content-Type" => "text/plain" }, [body]]
end
def hostname
Socket.gethostname
rescue StandardError
"unknown-hostname"
end
class << self
def run(default_port: 9090, **options)