This commit is contained in:
xx
2024-06-07 19:45:14 +08:00
parent ec05d480b0
commit 3cec02b819
3 changed files with 14 additions and 6 deletions

View File

@@ -64,7 +64,7 @@ namespace ylib
/// [测试] 生成GUID
/// </summary>
/// <returns></returns>
std::string test_make_guid();
//std::string test_make_guid();
private:
// 目录
std::string m_dirpath;

View File

@@ -220,7 +220,15 @@ void ylib::network::http::router::__thread_callback(reqpack* rp)
if(execed == false){
//其它回调
if (m_callback_other != nullptr) {
m_callback_other(rp->request(), rp->response());
try
{
m_callback_other(rp->request(), rp->response());
}
catch (const std::exception& e)
{
rp->response()->send((std::string)e.what(), 500, "Internal Server Error");
}
}else{
rp->response()->send((std::string)"Services that have not been processed",500,"Service Unavailable");
}

View File

@@ -65,7 +65,7 @@ bool ylib::local_storage::exist(const std::string& name)
return false;
}
std::string ylib::local_storage::test_make_guid()
{
return codec::md5(std::to_string(time::now_msec()) + std::to_string(m_guid_counter.make()));
}
//std::string ylib::local_storage::test_make_guid()
//{
// return codec::md5(std::to_string(time::now_msec()) + std::to_string(m_guid_counter.make()));
//}