Fixed tests in Sandbox [#CLICKHOUSE-2]

This commit is contained in:
Alexey Milovidov 2018-08-29 22:01:01 +03:00
parent 9d5c9b602d
commit c34d36bf35

View File

@ -73,10 +73,19 @@ void ThreadStatus::initPerformanceCounters()
*last_rusage = RUsageCounters::current(query_start_time_nanoseconds);
if (TaskStatsInfoGetter::checkPermissions())
try
{
taskstats_getter = std::make_unique<TaskStatsInfoGetter>();
*last_taskstats = TasksStatsCounters::current();
if (TaskStatsInfoGetter::checkPermissions())
{
if (!taskstats_getter)
taskstats_getter = std::make_unique<TaskStatsInfoGetter>();
*last_taskstats = TasksStatsCounters::current();
}
}
catch (...)
{
taskstats_getter.reset();
tryLogCurrentException(__PRETTY_FUNCTION__);
}
}