mirror of
https://github.com/KingDuckZ/kamokan.git
synced 2025-07-02 14:04:16 +00:00
Do the str to int conversion in the SettingsBag.
This commit is contained in:
parent
fe53ea7ea1
commit
79e82e2489
2 changed files with 36 additions and 4 deletions
|
@ -22,7 +22,6 @@
|
|||
#include "duckhandy/stringize.h"
|
||||
#include "pathname/pathname.hpp"
|
||||
#include "list_highlight_langs.hpp"
|
||||
#include "duckhandy/lexical_cast.hpp"
|
||||
#include <utility>
|
||||
#include <cassert>
|
||||
#include <fstream>
|
||||
|
@ -60,7 +59,7 @@ namespace tawashi {
|
|||
if (parSettings["redis_mode"] == "inet") {
|
||||
return IncRedis(
|
||||
parSettings.as<std::string>("redis_server"),
|
||||
dhandy::lexical_cast<uint16_t>(parSettings["redis_port"])
|
||||
parSettings.as<uint16_t>("redis_port")
|
||||
);
|
||||
}
|
||||
else if (parSettings["redis_mode"] == "sock") {
|
||||
|
@ -136,7 +135,7 @@ namespace tawashi {
|
|||
if (m_redis) {
|
||||
m_redis->wait_for_connect();
|
||||
auto batch = m_redis->make_batch();
|
||||
batch.select(dhandy::lexical_cast<int>((*m_settings)["redis_db"]));
|
||||
batch.select(m_settings->as<int>("redis_db"));
|
||||
batch.client_setname("tawashi_v" STRINGIZE(VERSION_MAJOR) "." STRINGIZE(VERSION_MINOR) "." STRINGIZE(VERSION_PATCH));
|
||||
batch.throw_if_failed();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue