mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-06-04 10:13:53 +08:00
update strategy publish bug
This commit is contained in:
@@ -19,11 +19,7 @@ func (s *StrategyClient) Online(ctx context.Context, resources ...*eosc.Base[gat
|
||||
s.client.Begin(ctx)
|
||||
for _, r := range resources {
|
||||
if r.Config.IsDelete {
|
||||
err := s.client.Del(ctx, genWorkerID(r.Config.Name, gateway.ProfessionStrategy))
|
||||
if err != nil {
|
||||
s.client.Rollback(ctx)
|
||||
return err
|
||||
}
|
||||
s.client.Del(ctx, genWorkerID(r.Config.Name, gateway.ProfessionStrategy))
|
||||
continue
|
||||
}
|
||||
err := s.client.Set(ctx, genWorkerID(r.Config.Name, gateway.ProfessionStrategy), r)
|
||||
|
||||
@@ -152,6 +152,9 @@ func (i *imlStrategyModule) ToPublish(ctx context.Context, driver string) ([]*st
|
||||
OptTime: l.UpdateAt,
|
||||
})
|
||||
}
|
||||
sort.Slice(items, func(i, j int) bool {
|
||||
return items[i].Priority < items[j].Priority
|
||||
})
|
||||
return items, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user