From 99c9ebb99becc47b4417dc728da517847a8c8a7c Mon Sep 17 00:00:00 2001 From: dapan1121 <89396746@qq.com> Date: Tue, 8 Jun 2021 14:46:25 +0800 Subject: [PATCH] fix bug --- src/plugins/monitor/src/monMain.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/monitor/src/monMain.c b/src/plugins/monitor/src/monMain.c index d9f7d81ebd..2c4a0c1a4c 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" -- GitLab