From 87ef103e600bd2b5f09c8388ebd334040d910d6e Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 10 Nov 2015 16:06:41 -0500 Subject: [PATCH] rgw: register RGWPeriodPusher with RGWRealmWatcher Signed-off-by: Casey Bodley --- src/rgw/rgw_main.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc index 8718ed48da0a3..9f233292bb0f4 100644 --- a/src/rgw/rgw_main.cc +++ b/src/rgw/rgw_main.cc @@ -39,6 +39,7 @@ #include "rgw_acl.h" #include "rgw_user.h" #include "rgw_op.h" +#include "rgw_period_pusher.h" #include "rgw_realm_reloader.h" #include "rgw_rest.h" #include "rgw_rest_s3.h" @@ -1103,17 +1104,23 @@ public: // FrontendPauser implementation for RGWRealmReloader class RGWFrontendPauser : public RGWRealmReloader::Pauser { std::list &frontends; + RGWRealmReloader::Pauser* pauser; public: - RGWFrontendPauser(std::list &frontends) - : frontends(frontends) {} + RGWFrontendPauser(std::list &frontends, + RGWRealmReloader::Pauser* pauser = nullptr) + : frontends(frontends), pauser(pauser) {} void pause() override { for (auto frontend : frontends) frontend->pause_for_new_config(); + if (pauser) + pauser->pause(); } void resume(RGWRados *store) { for (auto frontend : frontends) frontend->unpause_with_new_config(store); + if (pauser) + pauser->resume(store); } }; @@ -1340,11 +1347,13 @@ int main(int argc, const char **argv) } // add a watcher to respond to realm configuration changes - RGWFrontendPauser pauser(fes); + RGWPeriodPusher pusher(store); + RGWFrontendPauser pauser(fes, &pusher); RGWRealmReloader reloader(store, &pauser); RGWRealmWatcher realm_watcher(g_ceph_context, store->realm); realm_watcher.add_watcher(RGWRealmNotify::Reload, reloader); + realm_watcher.add_watcher(RGWRealmNotify::ZonesNeedPeriod, pusher); wait_shutdown(); -- 2.39.5