diff --git a/src/plugins/monitor/src/monMain.c b/src/plugins/monitor/src/monMain.c index d9f7d81ebd3eefe77569deb30b75c227ff79e04f..2c4a0c1a4c56e560a9ffe5ec007cc51f9d7f9e24 100644 --- a/src/plugins/monitor/src/monMain.c +++ b/src/plugins/monitor/src/monMain.c @@ -184,11 +184,17 @@ static void *monThreadFunc(void *param) { static void monBuildMonitorSql(char *sql, int32_t cmd) { memset(sql, 0, SQL_LENGTH); +#ifdef _STORAGE + char *keepValue = "30,30,30"; +#else + char *keepValue = "30"; +#endif + if (cmd == MON_CMD_CREATE_DB) { snprintf(sql, SQL_LENGTH, - "create database if not exists %s replica 1 days 10 keep 30 cache %d " + "create database if not exists %s replica 1 days 10 keep %s cache %d " "blocks %d precision 'us'", - tsMonitorDbName, TSDB_MIN_CACHE_BLOCK_SIZE, TSDB_MIN_TOTAL_BLOCKS); + tsMonitorDbName, keepValue, TSDB_MIN_CACHE_BLOCK_SIZE, TSDB_MIN_TOTAL_BLOCKS); } else if (cmd == MON_CMD_CREATE_MT_DN) { snprintf(sql, SQL_LENGTH, "create table if not exists %s.dn(ts timestamp"