1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2025-07-04 14:24:10 +00:00

Revert "Load save and delete scripts upon connection to Redis."

This reverts commit 1aacca9e21.
This commit is contained in:
King_DuckZ 2016-07-08 21:35:31 +01:00
parent e92ee0cef0
commit 678e8c90d1
4 changed files with 2 additions and 40 deletions

View file

@ -26,7 +26,6 @@
#include <yaml-cpp/yaml.h>
#include <array>
#include <cstdint>
#include <fstream>
#include <boost/range/empty.hpp>
namespace dindb {
@ -95,23 +94,6 @@ namespace dindb {
}
return retval;
}
std::string read_script (const dincore::SearchPaths& parSearch, const char* parName) {
const auto full_path = parSearch.first_hit(boost::string_ref(parName));
if (full_path.empty()) {
const std::string msg = std::string("Unable to locate and load Lua script \"") + parName + "\" from any of the given search paths";
throw std::runtime_error(msg);
}
std::ifstream script(full_path);
std::string retval;
script.seekg(0, std::ios::end);
retval.reserve(script.tellg());
script.seekg(0, std::ios::beg);
retval.assign(std::istreambuf_iterator<char>(script), std::istreambuf_iterator<char>());
return retval;
}
} //unnamed namespace
} //namespace dindb
@ -184,9 +166,6 @@ namespace dindb {
oss << "Error connecting to Redis: " << m_redis.connection_error();
throw std::runtime_error(oss.str());
}
m_script_save = m_redis.make_script(read_script(m_lua_script_paths, "save.lua"));
m_script_delete = m_redis.make_script(read_script(m_lua_script_paths, "delete.lua"));
}
void BackendRedis::disconnect() {