优化日志清理,波形缓存空间
This commit is contained in:
parent
aafa6226d9
commit
7c9a7a41fe
@ -354,11 +354,13 @@ void CleanLogFile(std::string log_dir, size_t retain) {
|
|||||||
|
|
||||||
void DiskSpaceCheck() {
|
void DiskSpaceCheck() {
|
||||||
std::string directory = "/opt/log";
|
std::string directory = "/opt/log";
|
||||||
|
std::string directory_data = "/opt/data";
|
||||||
while (1) {
|
while (1) {
|
||||||
boost::filesystem::space_info si = boost::filesystem::space("/opt");
|
boost::filesystem::space_info si = boost::filesystem::space("/opt");
|
||||||
if (si.free <= 20000000) {
|
if (si.free <= 20000000) {
|
||||||
zlog_warn(zct, "disk free space:%llu for /opt", si.free);
|
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");
|
boost::filesystem::space_info si1 = boost::filesystem::space("/opt");
|
||||||
if (si1.free <= 20000000) {
|
if (si1.free <= 20000000) {
|
||||||
zlog_warn(zct, "[DiskSpaceCheck] can not release enough space and clean more log file");
|
zlog_warn(zct, "[DiskSpaceCheck] can not release enough space and clean more log file");
|
||||||
|
|||||||
@ -21,9 +21,9 @@ std::vector<RecvData> g_VecWaveDataZ;
|
|||||||
std::map<std::string, compressWaveChannel> g_mapCompress;
|
std::map<std::string, compressWaveChannel> g_mapCompress;
|
||||||
std::map<std::string, WaveChannel> g_mapWaveChannel;
|
std::map<std::string, WaveChannel> g_mapWaveChannel;
|
||||||
|
|
||||||
unsigned char data[1024 * 30] = {0x00};
|
unsigned char data[96000] = {0x00};
|
||||||
unsigned char outdata[1024 * 50] = {0x00};
|
unsigned char outdata[96000] = {0x00};
|
||||||
unsigned char dealdata[1024 * 30] = {0x00};
|
unsigned char dealdata[96000] = {0x00};
|
||||||
char mqttData[512000] = {0};
|
char mqttData[512000] = {0};
|
||||||
|
|
||||||
void Uart::RecordBattery(std::string &strLongAddr, DataRecvStatic &dataStatic, std::string &nowTimetamp) {
|
void Uart::RecordBattery(std::string &strLongAddr, DataRecvStatic &dataStatic, std::string &nowTimetamp) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user