File tree 1 file changed +4
-10
lines changed
1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -2,32 +2,26 @@ package stream
2
2
3
3
import (
4
4
"encoding/json"
5
+
5
6
"github.com/0xJacky/Nginx-UI/internal/nginx"
6
7
"github.com/0xJacky/Nginx-UI/model"
7
8
"github.com/0xJacky/Nginx-UI/query"
8
9
"github.com/gin-gonic/gin"
9
10
"github.com/go-resty/resty/v2"
10
- "github.com/samber/lo"
11
11
"github.com/uozi-tech/cosy/logger"
12
12
)
13
13
14
14
// getSyncNodes returns the nodes that need to be synchronized by site name
15
15
func getSyncNodes (name string ) (nodes []* model.Environment ) {
16
16
configFilePath := nginx .GetConfPath ("streams-available" , name )
17
- s := query .Site
18
- site , err := s .Where (s .Path .Eq (configFilePath )).
19
- Preload (s .SiteCategory ).First ()
17
+ s := query .Stream
18
+ stream , err := s .Where (s .Path .Eq (configFilePath )).First ()
20
19
if err != nil {
21
20
logger .Error (err )
22
21
return
23
22
}
24
23
25
- syncNodeIds := site .SyncNodeIDs
26
- // inherit sync node ids from site category
27
- if site .SiteCategory != nil {
28
- syncNodeIds = append (syncNodeIds , site .SiteCategory .SyncNodeIds ... )
29
- }
30
- syncNodeIds = lo .Uniq (syncNodeIds )
24
+ syncNodeIds := stream .SyncNodeIDs
31
25
32
26
e := query .Environment
33
27
nodes , err = e .Where (e .ID .In (syncNodeIds ... )).Find ()
You can’t perform that action at this time.
0 commit comments