TD-1081 change httpContext keep time

This commit is contained in:
Shengliang Guan 2020-08-11 09:47:23 +08:00
parent 0ac540218a
commit 49944faf7d
4 changed files with 5 additions and 5 deletions

View File

@ -35,8 +35,8 @@
#include "mnodeVgroup.h" #include "mnodeVgroup.h"
#include "mnodeWrite.h" #include "mnodeWrite.h"
#define CONN_KEEP_TIME (tsShellActivityTimer * 3) #define CONN_KEEP_TIME (tsShellActivityTimer * 3000)
#define CONN_CHECK_TIME (tsShellActivityTimer * 2) #define CONN_CHECK_TIME (tsShellActivityTimer * 2000)
#define QUERY_ID_SIZE 20 #define QUERY_ID_SIZE 20
#define QUERY_STREAM_SAVE_SIZE 20 #define QUERY_STREAM_SAVE_SIZE 20

View File

@ -389,7 +389,7 @@ static bool mnodeAccquireShowObj(SShowObj *pShow) {
static void* mnodePutShowObj(SShowObj *pShow) { static void* mnodePutShowObj(SShowObj *pShow) {
if (tsMnodeShowCache != NULL) { if (tsMnodeShowCache != NULL) {
pShow->index = atomic_add_fetch_32(&tsShowObjIndex, 1); pShow->index = atomic_add_fetch_32(&tsShowObjIndex, 1);
SShowObj **ppShow = taosCachePut(tsMnodeShowCache, &pShow, sizeof(int64_t), &pShow, sizeof(int64_t), 6); SShowObj **ppShow = taosCachePut(tsMnodeShowCache, &pShow, sizeof(int64_t), &pShow, sizeof(int64_t), 6000);
pShow->ppShow = (void**)ppShow; pShow->ppShow = (void**)ppShow;
mDebug("%p, show is put into cache, data:%p index:%d", pShow, ppShow, pShow->index); mDebug("%p, show is put into cache, data:%p index:%d", pShow, ppShow, pShow->index);
return pShow; return pShow;

View File

@ -108,7 +108,7 @@ HttpContext *httpCreateContext(int32_t fd) {
pContext->lastAccessTime = taosGetTimestampSec(); pContext->lastAccessTime = taosGetTimestampSec();
pContext->state = HTTP_CONTEXT_STATE_READY; pContext->state = HTTP_CONTEXT_STATE_READY;
HttpContext **ppContext = taosCachePut(tsHttpServer.contextCache, &pContext, sizeof(int64_t), &pContext, sizeof(int64_t), 3); HttpContext **ppContext = taosCachePut(tsHttpServer.contextCache, &pContext, sizeof(int64_t), &pContext, sizeof(int64_t), 3000);
pContext->ppContext = ppContext; pContext->ppContext = ppContext;
httpDebug("context:%p, fd:%d, is created, data:%p", pContext, fd, ppContext); httpDebug("context:%p, fd:%d, is created, data:%p", pContext, fd, ppContext);

View File

@ -34,7 +34,7 @@ void httpCreateSession(HttpContext *pContext, void *taos) {
session.refCount = 1; session.refCount = 1;
int32_t len = snprintf(session.id, HTTP_SESSION_ID_LEN, "%s.%s", pContext->user, pContext->pass); int32_t len = snprintf(session.id, HTTP_SESSION_ID_LEN, "%s.%s", pContext->user, pContext->pass);
pContext->session = taosCachePut(server->sessionCache, session.id, len, &session, sizeof(HttpSession), tsHttpSessionExpire); pContext->session = taosCachePut(server->sessionCache, session.id, len, &session, sizeof(HttpSession), tsHttpSessionExpire * 1000);
// void *temp = pContext->session; // void *temp = pContext->session;
// taosCacheRelease(server->sessionCache, (void **)&temp, false); // taosCacheRelease(server->sessionCache, (void **)&temp, false);