The .close() method flushes the stream, but it may throw doing it. Next
patch will want .close() not to throw, for that stream must be flushed
explicitly before closing.
diff --git a/api/task_manager.cc b/api/task_manager.cc
--- a/api/task_manager.cc
+++ b/api/task_manager.cc
@@ -151,6 +151,7 @@ void set_task_manager(http_context& ctx, routes& r, sharded<tasks::task_manager>
}
}
co_await s.write("]");
+ co_await s.flush();
co_await s.close();
};
co_return std::move(f);