File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed
Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ core/xpack
4949core /router /entry_xpack.go
5050core /server /init_xpack.go
5151core /utils /xpack /xpack_xpack.go
52+ core /xpack-ee
53+ core /router /entry_xpack_ee.go
54+ core /server /init_xpack_ee.go
55+ core /utils /xpack /xpack_xpack_ee.go
5256xpack
5357
5458.history /
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ func (c *ClamService) LoadBaseInfo() (dto.ClamBaseInfo, error) {
9696 }
9797 }
9898 } else {
99- _ = clam .StopAllClamJob (false , clamRepo )
99+ _ = clam .CheckWithStopAll (false , clamRepo )
100100 }
101101 if baseInfo .FreshIsActive {
102102 version , err := cmd .RunDefaultWithStdoutBashC ("freshclam --version" )
@@ -313,7 +313,7 @@ func (c *ClamService) Delete(req dto.ClamDelete) error {
313313}
314314
315315func (c * ClamService ) HandleOnce (id uint ) error {
316- if active := clam .StopAllClamJob (true , clamRepo ); ! active {
316+ if active := clam .CheckWithStopAll (true , clamRepo ); ! active {
317317 return buserr .New ("ErrClamdscanNotFound" )
318318 }
319319 clamItem , _ := clamRepo .Get (repo .WithByID (id ))
Original file line number Diff line number Diff line change @@ -63,21 +63,21 @@ func AnalysisFromLog(pathItem string, record *model.ClamRecord) {
6363 }
6464}
6565
66- func StopAllClamJob (withCheck bool , clamRepo repo.IClamRepo ) bool {
66+ func CheckWithStopAll (withCheck bool , clamRepo repo.IClamRepo ) bool {
6767 if withCheck {
6868 isExist , _ := controller .CheckExist ("clam" )
6969 if ! isExist {
7070 return false
7171 }
7272 isActive , _ := controller .CheckActive ("clam" )
73- if ! isActive {
74- return false
73+ if isActive {
74+ return true
7575 }
7676 }
7777 clams , _ := clamRepo .List (repo .WithByStatus (constant .StatusEnable ))
7878 for i := 0 ; i < len (clams ); i ++ {
7979 global .Cron .Remove (cron .EntryID (clams [i ].EntryID ))
8080 _ = clamRepo .Update (clams [i ].ID , map [string ]interface {}{"status" : constant .StatusDisable , "entry_id" : 0 })
8181 }
82- return true
82+ return false
8383}
You can’t perform that action at this time.
0 commit comments