完善日志系统,修复读取配置文件时的内存泄漏,初步添加熔断机制与指数退避机制

This commit is contained in:
2025-10-11 16:57:27 +08:00
parent f518bf5064
commit 331c6b9f89
14 changed files with 104 additions and 43 deletions

View File

@ -6,6 +6,8 @@
#define SIG_MOD 0
#define FILE_MOD 1
#include "tools/log/log.h"
typedef struct
{
char name[256];
@ -38,11 +40,12 @@ typedef struct ctx
char command[MAX_BUF];//当前行缓存
int statue;//当前状态
int fifofd[2];
log_manager *log_manager;
}ctx;//上下文管理
int interpret(int mod, ctx *all_ctx,Cmd *cmd_dic);
int init_interpreter(Cmd *cmd_dic,ctx *self,int fifo[2]);
int init_interpreter(Cmd *cmd_dic,ctx *self,int fifo[2],log_manager *log_manager);
#define ARG_LENGTH 256