mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-30 03:22:14 +00:00
38b2dec354
* Move getFQDNOrHostName to base/common/ * Add argsToConfig to ya.make * Add coverage.cpp to ya.make Also remove WITH_COVERAGE from config file
26 lines
427 B
C++
26 lines
427 B
C++
#include <Poco/Net/DNS.h>
|
|
#include <common/getFQDNOrHostName.h>
|
|
|
|
|
|
namespace
|
|
{
|
|
std::string getFQDNOrHostNameImpl()
|
|
{
|
|
try
|
|
{
|
|
return Poco::Net::DNS::thisHost().name();
|
|
}
|
|
catch (...)
|
|
{
|
|
return Poco::Net::DNS::hostName();
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
const std::string & getFQDNOrHostName()
|
|
{
|
|
static std::string result = getFQDNOrHostNameImpl();
|
|
return result;
|
|
}
|