提交 34efc168 编写于 作者: S Shengliang Guan

TD-2808

上级 29394ec8
......@@ -20,6 +20,7 @@
#undef TAOS_MEM_CHECK
bool simAsyncQuery = false;
bool simExecSuccess = false;
void simHandleSignal(int32_t signo) {
simSystemCleanUp();
......@@ -62,5 +63,8 @@ int32_t main(int32_t argc, char *argv[]) {
simScriptList[++simScriptPos] = script;
simExecuteScript(script);
return 0;
int32_t ret = simExecSuccess ? 0 : -1;
simError("execute result %d", ret);
return ret;
}
\ No newline at end of file
......@@ -21,6 +21,7 @@
#include "ttimer.h"
#include "tutil.h"
#include "tsocket.h"
#include "taoserror.h"
#undef TAOS_MEM_CHECK
SScript *simScriptList[MAX_MAIN_SCRIPT_NUM];
......@@ -31,6 +32,8 @@ int32_t simDebugFlag = 135;
void simCloseTaosdConnect(SScript *script);
char simHostName[128];
extern bool simExecSuccess;
char *simParseArbitratorName(char *varName) {
static char hostName[140];
sprintf(hostName, "%s:%d", simHostName, 8000);
......@@ -118,10 +121,12 @@ SScript *simProcessCallOver(SScript *script) {
if (script->type == SIM_SCRIPT_TYPE_MAIN) {
simDebug("script:%s, is main script, set stop flag", script->fileName);
if (script->killed) {
simExecSuccess = false;
simInfo("script:" FAILED_PREFIX "%s" FAILED_POSTFIX ", " FAILED_PREFIX "failed" FAILED_POSTFIX ", error:%s",
script->fileName, script->error);
return NULL;
} else {
simExecSuccess = true;
simInfo("script:" SUCCESS_PREFIX "%s" SUCCESS_POSTFIX ", " SUCCESS_PREFIX "success" SUCCESS_POSTFIX,
script->fileName);
simCloseTaosdConnect(script);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册