Loading plugins/media/media.cpp +25 −4 Original line number Diff line number Diff line Loading @@ -1619,15 +1619,36 @@ namespace blogi { void _ensureMdbReady(int tid, const std::string &token = ""){ if(!_mdb[tid]){ try { _mdb[tid] = std::make_unique<mediadb::Client>(_mdbUrl, false, true); } catch(std::exception &e) { std::cerr << "media: _ensureMdbReady: new Client failed: " << e.what() << std::endl; throw; } } if(!token.empty()){ try { _mdb[tid]->set_token(token); } catch(...) { } catch(std::exception &e) { // Connection broken — recreate client and retry std::cerr << "media: _ensureMdbReady: set_token failed, reconnecting: " << e.what() << std::endl; try { _mdb[tid] = std::make_unique<mediadb::Client>(_mdbUrl, false, true); _mdb[tid]->set_token(token); } catch(std::exception &e2) { std::cerr << "media: _ensureMdbReady: reconnect failed: " << e2.what() << std::endl; _mdb[tid].reset(); throw; } } catch(...) { std::cerr << "media: _ensureMdbReady: set_token unknown error, reconnecting" << std::endl; try { _mdb[tid] = std::make_unique<mediadb::Client>(_mdbUrl, false, true); _mdb[tid]->set_token(token); } catch(...) { _mdb[tid].reset(); throw; } } } } Loading Loading
plugins/media/media.cpp +25 −4 Original line number Diff line number Diff line Loading @@ -1619,15 +1619,36 @@ namespace blogi { void _ensureMdbReady(int tid, const std::string &token = ""){ if(!_mdb[tid]){ try { _mdb[tid] = std::make_unique<mediadb::Client>(_mdbUrl, false, true); } catch(std::exception &e) { std::cerr << "media: _ensureMdbReady: new Client failed: " << e.what() << std::endl; throw; } } if(!token.empty()){ try { _mdb[tid]->set_token(token); } catch(...) { } catch(std::exception &e) { // Connection broken — recreate client and retry std::cerr << "media: _ensureMdbReady: set_token failed, reconnecting: " << e.what() << std::endl; try { _mdb[tid] = std::make_unique<mediadb::Client>(_mdbUrl, false, true); _mdb[tid]->set_token(token); } catch(std::exception &e2) { std::cerr << "media: _ensureMdbReady: reconnect failed: " << e2.what() << std::endl; _mdb[tid].reset(); throw; } } catch(...) { std::cerr << "media: _ensureMdbReady: set_token unknown error, reconnecting" << std::endl; try { _mdb[tid] = std::make_unique<mediadb::Client>(_mdbUrl, false, true); _mdb[tid]->set_token(token); } catch(...) { _mdb[tid].reset(); throw; } } } } Loading