修改连接超时时间为2s
This commit is contained in:
parent
dcc86888b2
commit
57d21beb27
|
@ -86,6 +86,9 @@ HGResult HGPdtToolDbUserMgrImpl::Create(const HGChar* host, HGUShort port, const
|
||||||
return HGBASE_ERR_FAIL;
|
return HGBASE_ERR_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int timeout = 2;
|
||||||
|
mysql_options(sql, MYSQL_OPT_CONNECT_TIMEOUT, (const char*)&timeout);
|
||||||
|
|
||||||
if (NULL == mysql_real_connect(sql, host, "huago", "huago", "huago_production_tool", port, NULL, 0))
|
if (NULL == mysql_real_connect(sql, host, "huago", "huago", "huago_production_tool", port, NULL, 0))
|
||||||
{
|
{
|
||||||
// 连接错误
|
// 连接错误
|
||||||
|
@ -723,7 +726,7 @@ HGResult HGPdtToolDbUserMgrImpl::Export(const HGChar* xlsPath)
|
||||||
if (NULL == file)
|
if (NULL == file)
|
||||||
{
|
{
|
||||||
mysql_free_result(sqlRes);
|
mysql_free_result(sqlRes);
|
||||||
return HGBASE_ERR_FAIL;
|
return HGBASE_ERR_ACCESSDENIED;
|
||||||
}
|
}
|
||||||
|
|
||||||
const HGChar* MAIN_TEST_CN[] = {"设备序列号", "创建时间", "创建用户", "最后修改时间", "最后修改用户",
|
const HGChar* MAIN_TEST_CN[] = {"设备序列号", "创建时间", "创建用户", "最后修改时间", "最后修改用户",
|
||||||
|
|
Loading…
Reference in New Issue