| 216 | if (extra.method == "GET" && extra.path == "/v1/recipes") { |
| 217 | return json_response(recipes_json()); |
| 218 | } |
| 219 | if (extra.method == "POST" && extra.path == "/v1/recipes/run") { |
| 220 | return handle_recipe_run(extra.body); |
| 221 | } |
| 222 | return std::nullopt; |
| 223 | }); |
| 224 | if (response.stream_body) { |
| 225 | const int threads = config_.threads; |
| 226 | auto inner = std::move(response.stream_body); |
| 227 | response.stream_body = [threads, inner = std::move(inner)](HttpStreamWriter & writer) { |
| 228 | const ScopedOmpNumThreads stream_omp_threads(threads); |
| 229 | inner(writer); |
| 230 | }; |
no test coverage detected