mirror of
https://github.com/IceWhaleTech/CasaOS.git
synced 2025-11-06 22:59:44 +00:00
Update send data interval
This commit is contained in:
parent
7a2cee22c3
commit
e3f52f1595
@ -18,7 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Fixed
|
||||
|
||||
## [0.3.2-pre] - 2022-06-08
|
||||
## [0.3.2] - 2022-06-10
|
||||
|
||||
### Added
|
||||
|
||||
|
||||
2
main.go
2
main.go
@ -100,7 +100,7 @@ func main() {
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
err = cron2.AddFunc("0/3 * * * * *", func() {
|
||||
err = cron2.AddFunc("0/5 * * * * *", func() {
|
||||
if service.ClientCount > 0 {
|
||||
// route.SendNetINfoBySocket()
|
||||
// route.SendCPUBySocket()
|
||||
|
||||
@ -199,7 +199,6 @@ func GetDownloadFile(c *gin.Context) {
|
||||
defer ar.Close()
|
||||
commonDir := file.CommonPrefix(filepath.Separator, list...)
|
||||
|
||||
|
||||
currentPath := filepath.Base(commonDir)
|
||||
|
||||
name := "_" + currentPath
|
||||
@ -278,17 +277,20 @@ func DirPath(c *gin.Context) {
|
||||
|
||||
//Hide the files or folders in operation
|
||||
fileQueue := make(map[string]string)
|
||||
for _, v := range service.OpStrArr {
|
||||
v, ok := service.FileQueue.Load(v)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
vt := v.(model.FileOperate)
|
||||
for _, i := range vt.Item {
|
||||
lastPath := i.From[strings.LastIndex(i.From, "/")+1:]
|
||||
fileQueue[vt.To+"/"+lastPath] = i.From
|
||||
if len(service.OpStrArr) > 0 {
|
||||
for _, v := range service.OpStrArr {
|
||||
v, ok := service.FileQueue.Load(v)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
vt := v.(model.FileOperate)
|
||||
for _, i := range vt.Item {
|
||||
lastPath := i.From[strings.LastIndex(i.From, "/")+1:]
|
||||
fileQueue[vt.To+"/"+lastPath] = i.From
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pathList := []model.Path{}
|
||||
for i := 0; i < len(info); i++ {
|
||||
if _, ok := fileQueue[info[i].Path]; !ok {
|
||||
|
||||
@ -67,7 +67,7 @@ func (d *diskService) SmartCTL(path string) model.SmartctlA {
|
||||
loger.Error("Failed to unmarshal json", zap.Any("err", err))
|
||||
}
|
||||
if !reflect.DeepEqual(m, model.SmartctlA{}) {
|
||||
Cache.Add(key, m, time.Second*10)
|
||||
Cache.Add(key, m, time.Hour*24)
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user