You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

restartlistlogic.go 1.1 kB

123456789101112131415161718192021222324252627282930313233343536
  1. package participantservicelogic
  2. import (
  3. "context"
  4. "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/internal/svc"
  5. "gitlink.org.cn/jcce-pcm/pcm-coordinator/rpc/pcmCore"
  6. "github.com/zeromicro/go-zero/core/logx"
  7. )
  8. type RestartListLogic struct {
  9. ctx context.Context
  10. svcCtx *svc.ServiceContext
  11. logx.Logger
  12. }
  13. func NewRestartListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RestartListLogic {
  14. return &RestartListLogic{
  15. ctx: ctx,
  16. svcCtx: svcCtx,
  17. Logger: logx.WithContext(ctx),
  18. }
  19. }
  20. // RestartList 重启任务列表
  21. func (l *RestartListLogic) RestartList(in *pcmCore.ApplyListReq) (*pcmCore.ApplyListResp, error) {
  22. result := pcmCore.ApplyListResp{
  23. InfoList: make([]*pcmCore.ApplyInfo, 0),
  24. }
  25. l.svcCtx.DbEngin.Raw("SELECT sppi.`name` as ParticipantName, c.ns_id as namespace,c.name as name , c.kind as kind FROM cloud c,sc_participant_phy_info sppi where c.`status` = 'WaitRestart' and sppi.id = c.participant_id").Scan(&result.InfoList)
  26. if len(result.InfoList) != 0 {
  27. l.svcCtx.DbEngin.Exec("update cloud set status = ? where status = ?", "Issued", "WaitRestart")
  28. }
  29. return &result, nil
  30. }

PCM is positioned as Software stack over Cloud, aiming to build the standards and ecology of heterogeneous cloud collaboration for JCC in a non intrusive and autonomous peer-to-peer manner.