Add file version in json file.
This commit is contained in:
parent
c50781d089
commit
94c91085d6
|
@ -31,6 +31,9 @@ extern "C" {
|
||||||
#define SLOW_LOG_TYPE_OTHERS 0x4
|
#define SLOW_LOG_TYPE_OTHERS 0x4
|
||||||
#define SLOW_LOG_TYPE_ALL 0x7
|
#define SLOW_LOG_TYPE_ALL 0x7
|
||||||
|
|
||||||
|
#define GLOBAL_CONFIG_FILE_VERSION 1
|
||||||
|
#define LOCAL_CONFIG_FILE_VERSION 1
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
DND_CA_SM4 = 1,
|
DND_CA_SM4 = 1,
|
||||||
} EEncryptAlgor;
|
} EEncryptAlgor;
|
||||||
|
|
|
@ -2768,6 +2768,7 @@ int32_t globalConfigSerialize(int32_t version, SArray *array, char **serialized)
|
||||||
char buf[30];
|
char buf[30];
|
||||||
cJSON *json = cJSON_CreateObject();
|
cJSON *json = cJSON_CreateObject();
|
||||||
if (json == NULL) goto _exit;
|
if (json == NULL) goto _exit;
|
||||||
|
if (cJSON_AddNumberToObject(json, "file_version", GLOBAL_CONFIG_FILE_VERSION) == NULL) goto _exit;
|
||||||
if (cJSON_AddNumberToObject(json, "version", version) == NULL) goto _exit;
|
if (cJSON_AddNumberToObject(json, "version", version) == NULL) goto _exit;
|
||||||
int sz = taosArrayGetSize(array);
|
int sz = taosArrayGetSize(array);
|
||||||
|
|
||||||
|
@ -2828,7 +2829,7 @@ int32_t localConfigSerialize(SArray *array, char **serialized) {
|
||||||
|
|
||||||
cJSON *cField = cJSON_CreateObject();
|
cJSON *cField = cJSON_CreateObject();
|
||||||
if (cField == NULL) goto _exit;
|
if (cField == NULL) goto _exit;
|
||||||
|
if (cJSON_AddNumberToObject(json, "file_version", LOCAL_CONFIG_FILE_VERSION) == NULL) goto _exit;
|
||||||
if (!cJSON_AddItemToObject(json, "configs", cField)) goto _exit;
|
if (!cJSON_AddItemToObject(json, "configs", cField)) goto _exit;
|
||||||
|
|
||||||
// cjson only support int32_t or double
|
// cjson only support int32_t or double
|
||||||
|
|
Loading…
Reference in New Issue