fix: 调整/tmp文件路径到/usr/local/omc

This commit is contained in:
TsMask
2025-06-11 18:31:10 +08:00
parent 2fc70a58ba
commit e35287e8c1
5 changed files with 86 additions and 78 deletions

View File

@@ -119,7 +119,7 @@ func (s *Packet) LiveStart(taskNo, deviceName, filterBPF string, outputPCAP bool
var f *os.File
if outputPCAP {
// 网管本地路径
localFilePath := fmt.Sprintf("/tmp/omc/packet/%s.pcap", taskNo)
localFilePath := fmt.Sprintf("/usr/local/omc/packet/%s.pcap", taskNo)
if runtime.GOOS == "windows" {
localFilePath = fmt.Sprintf("C:%s", localFilePath)
}
@@ -203,7 +203,9 @@ func (s *Packet) capturePacketSource(taskInfo *Task) {
if packet == nil {
continue
}
if packet.Metadata().Timestamp.Before(time.Now()) {
// 如果延迟超过1秒跳过
timeDiff := time.Since(packet.Metadata().Timestamp)
if timeDiff > time.Second {
continue
}