fix: no more fetch when it is already fetching
This commit is contained in:
parent
455719befa
commit
596764479f
|
@ -672,11 +672,14 @@ void ctgTestRspUdfInfo(void *shandle, SEpSet *pEpSet, SRpcMsg *pMsg, SRpcMsg *pR
|
|||
SRetrieveFuncRsp funcRsp = {0};
|
||||
funcRsp.numOfFuncs = 1;
|
||||
funcRsp.pFuncInfos = taosArrayInit(1, sizeof(SFuncInfo));
|
||||
funcRsp.pFuncVersions = taosArrayInit(1, sizeof(int32_t));
|
||||
SFuncInfo funcInfo = {0};
|
||||
strcpy(funcInfo.name, "func1");
|
||||
funcInfo.funcType = ctgTestFuncType;
|
||||
|
||||
(void)taosArrayPush(funcRsp.pFuncInfos, &funcInfo);
|
||||
int32_t version = 0;
|
||||
(void)taosArrayPush(funcRsp.pFuncVersions, &version);
|
||||
|
||||
int32_t rspLen = tSerializeSRetrieveFuncRsp(NULL, 0, &funcRsp);
|
||||
void *pReq = rpcMallocCont(rspLen);
|
||||
|
|
|
@ -581,6 +581,7 @@ int32_t udfdInitUdf(char *udfName, SUdf *udf) {
|
|||
SUdf *udfdNewUdf(const char *udfName) {
|
||||
SUdf *udfNew = taosMemoryCalloc(1, sizeof(SUdf));
|
||||
udfNew->refCount = 1;
|
||||
udfNew->lastFetchTime = taosGetTimestampUs();
|
||||
strncpy(udfNew->name, udfName, TSDB_FUNC_NAME_LEN);
|
||||
|
||||
udfNew->state = UDF_STATE_INIT;
|
||||
|
@ -618,6 +619,7 @@ SUdf *udfdGetOrCreateUdf(const char *udfName) {
|
|||
}
|
||||
|
||||
SUdf *udf = udfdNewUdf(udfName);
|
||||
|
||||
SUdf **pUdf = &udf;
|
||||
taosHashPut(global.udfsHash, udfName, strlen(udfName), pUdf, POINTER_BYTES);
|
||||
uv_mutex_unlock(&global.udfsMutex);
|
||||
|
@ -902,8 +904,8 @@ void udfdProcessRpcRsp(void *parent, SRpcMsg *pMsg, SEpSet *pEpSet) {
|
|||
udf->version = *(int32_t *)taosArrayGet(retrieveRsp.pFuncVersions, 0);
|
||||
|
||||
msgInfo->code = udfdSaveFuncBodyToFile(pFuncInfo, udf);
|
||||
if (msgInfo->code == 0) {
|
||||
udf->lastFetchTime = taosGetTimestampUs();
|
||||
if (msgInfo->code != 0) {
|
||||
udf->lastFetchTime = 0;
|
||||
}
|
||||
tFreeSFuncInfo(pFuncInfo);
|
||||
taosArrayDestroy(retrieveRsp.pFuncInfos);
|
||||
|
|
Loading…
Reference in New Issue