优化日志清理,波形缓存空间

This commit is contained in:
zhangsheng 2024-11-25 15:22:07 +08:00
parent aafa6226d9
commit 7c9a7a41fe
2 changed files with 6 additions and 4 deletions

View File

@ -354,11 +354,13 @@ void CleanLogFile(std::string log_dir, size_t retain) {
void DiskSpaceCheck() {
std::string directory = "/opt/log";
std::string directory_data = "/opt/data";
while (1) {
boost::filesystem::space_info si = boost::filesystem::space("/opt");
if (si.free <= 20000000) {
zlog_warn(zct, "disk free space:%llu for /opt", si.free);
CleanLogFile(directory, 10);
CleanLogFile(directory, 10);
CleanLogFile(directory_data, 100);
boost::filesystem::space_info si1 = boost::filesystem::space("/opt");
if (si1.free <= 20000000) {
zlog_warn(zct, "[DiskSpaceCheck] can not release enough space and clean more log file");

View File

@ -21,9 +21,9 @@ std::vector<RecvData> g_VecWaveDataZ;
std::map<std::string, compressWaveChannel> g_mapCompress;
std::map<std::string, WaveChannel> g_mapWaveChannel;
unsigned char data[1024 * 30] = {0x00};
unsigned char outdata[1024 * 50] = {0x00};
unsigned char dealdata[1024 * 30] = {0x00};
unsigned char data[96000] = {0x00};
unsigned char outdata[96000] = {0x00};
unsigned char dealdata[96000] = {0x00};
char mqttData[512000] = {0};
void Uart::RecordBattery(std::string &strLongAddr, DataRecvStatic &dataStatic, std::string &nowTimetamp) {