File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -2,32 +2,26 @@ package stream
22
33import (
44 "encoding/json"
5+
56 "github.com/0xJacky/Nginx-UI/internal/nginx"
67 "github.com/0xJacky/Nginx-UI/model"
78 "github.com/0xJacky/Nginx-UI/query"
89 "github.com/gin-gonic/gin"
910 "github.com/go-resty/resty/v2"
10- "github.com/samber/lo"
1111 "github.com/uozi-tech/cosy/logger"
1212)
1313
1414// getSyncNodes returns the nodes that need to be synchronized by site name
1515func getSyncNodes (name string ) (nodes []* model.Environment ) {
1616 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 ()
2019 if err != nil {
2120 logger .Error (err )
2221 return
2322 }
2423
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
3125
3226 e := query .Environment
3327 nodes , err = e .Where (e .ID .In (syncNodeIds ... )).Find ()
You can’t perform that action at this time.
0 commit comments