如果每个服务有一个SELECT "categories".* FROM "categories"
WHERE (
NOT ("categories"."external_id" = '_reserved' AND "categories"."external_id" IS NOT NULL)
AND "categories"."is_promo" = 0
AND "categories"."begins_on" <= to_timestamp('2018-11-27', 'YYYY-MM-DD')
AND "categories"."ends_on" >= to_timestamp('2018-11-27', 'YYYY-MM-DD')
AND (EXISTS(
SELECT U0."id" FROM "productprices" U0
INNER JOIN "products" U1 ON (U0."product_id" = U1."id")
INNER JOIN "products_categories" U2 ON (U1."id" = U2."product_id")
WHERE (
U2."category_id" = ("categories"."id")
AND U0."updated_at" >= to_timestamp('2018-11-27 00:00:00', 'YYYY-MM-DD HH24:MI:SS')
AND U0."store_id" = 42
AND U0."begins_on" <= to_timestamp('2018-11-27 09:00:00', 'YYYY-MM-DD HH24:MI:SS')
AND U0."ends_on" >= to_timestamp('2018-11-27 09:00:00', 'YYYY-MM-DD HH24:MI:SS')
AND (U0."discount" IS NOT NULL OR U1."has_special_offer" = 1)
AND U1."is_adult" = 0))
)
)
ORDER BY "categories"."tree_id" ASC, "categories"."lft" ASC
,则很容易实现“运行状况检查”路由并将其Http().bindAndHandle
连接到其他路由。
但是,在我的情况下,每个服务在不同端口上的http 服务器很少:
~
我想实施healthCheck来返回有关所有服务器的运行状况信息。
我幼稚的方法是做类似的事情:
for {
_ <- Http().bindAndHandle(routes1, "0.0.0.0", 9090)
_ <- Http().bindAndHandle(routes2, "0.0.0.0", 9091)
} yield ()
可以,但是似乎我缺少了一些东西。是否存在实施此类健康检查的更好方法?