Fixed MySQL

This commit is contained in:
WolverinDEV 2020-08-22 21:34:35 +02:00
parent a78c36c999
commit 4a7a9e7228
2 changed files with 8 additions and 6 deletions

View File

@ -86,8 +86,8 @@ void WebClient::initialize() {
} }
}; };
this->ws_handler.on_connect = bind(&WebClient::onWSConnected, this); this->ws_handler.on_connect = std::bind(&WebClient::onWSConnected, this);
this->ws_handler.on_disconnect = bind(&WebClient::onWSDisconnected, this, placeholders::_1); this->ws_handler.on_disconnect = std::bind(&WebClient::onWSDisconnected, this, placeholders::_1);
this->ws_handler.callback_data([&](const pipes::WSMessage& msg){ this->ws_handler.callback_data([&](const pipes::WSMessage& msg){
this->onWSMessage(msg); this->onWSMessage(msg);

View File

@ -191,10 +191,12 @@ bool SqlDataManager::initialize(std::string& error) {
return false; return false;
} }
res = sql::command{this->sql(), "DELETE FROM `general` WHERE `id` IN (SELECT `id` FROM `general` WHERE `key` = :key ORDER BY `key` LIMIT 1, -1);", variable{":key", "lock_test"}}.execute(); if(this->sql()->getType() == sql::TYPE_SQLITE) {
if(!res) { res = sql::command{this->sql(), "DELETE FROM `general` WHERE `id` IN (SELECT `id` FROM `general` WHERE `key` = :key ORDER BY `key` LIMIT 1, -1);", variable{":key", "lock_test"}}.execute();
error = res.fmtStr(); if(!res) {
return false; error = res.fmtStr();
return false;
}
} }
} }