Skip to content

Add  DatabasePropertyManager  for database shutdown/startup cleanup after upstream is merged #640

Description

@mariuz

asfernandes/fb-cpp#56

Once that PR is merged, the flamerobin side can be simplified —  FbCppService::shutdown()  and  FbCppService::startup()  can be replaced with clean calls to  fbcpp::DatabasePropertyManager :

void FbCppService::shutdown(const ShutdownConfig& config)
{
if (!clientM)
connect();

runService([this, config]() {
    try {
        pushLine("Shutting down database " + config.dbPath + "...");
        auto svcOptions = /* ... */;
        fbcpp::DatabasePropertyManager mgr(*clientM, svcOptions);
        mgr.shutdown(fbcpp::ShutdownOptions()
            .setDatabase(config.dbPath)
            .setMode(/* map ShutdownMode */)
            .setTimeout(config.timeout));
        pushLine("Shutdown done.");
    } catch (const std::exception& e) {
        pushLine(std::string("Error: ") + e.what());
    }
    pushLine("");
});

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions