| 2286 | } |
| 2287 | |
| 2288 | void updateAsyncQueryStatus( |
| 2289 | ContextMutablePtr context, |
| 2290 | const String & async_query_id, |
| 2291 | const String & query_id, |
| 2292 | const AsyncQueryStatus::Status & status, |
| 2293 | const String & error_msg) |
| 2294 | { |
| 2295 | AsyncQueryStatus async_query_status; |
| 2296 | if (!context->getCnchCatalog()->tryGetAsyncQueryStatus(async_query_id, async_query_status)) |
| 2297 | { |
| 2298 | LOG_WARNING( |
| 2299 | &Poco::Logger::get("executeQuery"), "async query status not found, insert new one with async_query_id: {}", async_query_id); |
| 2300 | async_query_status.set_id(async_query_id); |
| 2301 | async_query_status.set_query_id(query_id); |
| 2302 | } |
| 2303 | async_query_status.set_status(status); |
| 2304 | async_query_status.set_update_time(time(nullptr)); |
| 2305 | |
| 2306 | if (!error_msg.empty() && status == AsyncQueryStatus::Failed) |
| 2307 | { |
| 2308 | async_query_status.set_error_msg(error_msg); |
| 2309 | } |
| 2310 | |
| 2311 | context->getCnchCatalog()->setAsyncQueryStatus(async_query_id, async_query_status); |
| 2312 | } |
| 2313 | |
| 2314 | void executeHttpQueryInAsyncMode( |
| 2315 | String & query1, |
no test coverage detected