mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/yunionio/cloudpods.git
synced 2026-09-20 08:03:53 +08:00
fix(notify): lock panic when InitializeData
This commit is contained in:
@@ -78,7 +78,8 @@ func (rm *SRobotManager) fetchSystemProjectId(ctx context.Context) (string, erro
|
||||
func (rm *SRobotManager) InitializeData() error {
|
||||
log.Infof("start to init data for notify robot")
|
||||
// init empty projectId robot
|
||||
systemId, err := rm.fetchSystemProjectId(context.Background())
|
||||
ctx := context.WithValue(context.Background(), "from", "init")
|
||||
systemId, err := rm.fetchSystemProjectId(ctx)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "unable to fetch system project id")
|
||||
}
|
||||
@@ -149,7 +150,6 @@ func (rm *SRobotManager) InitializeData() error {
|
||||
}
|
||||
robots = append(robots, robot)
|
||||
}
|
||||
ctx := context.Background()
|
||||
var webhookRobotId string
|
||||
// insert new robot
|
||||
for i := range robots {
|
||||
|
||||
Reference in New Issue
Block a user