(orgID string, warehouse *configstore.ManagedWarehouse)
| 328 | err := s.db().Transaction(func(tx *gorm.DB) error { |
| 329 | // Serialize with org connection admission (request-owned leases read |
| 330 | // org limits under this lock) — see LockOrgConnectionAdmissionTx. |
| 331 | if err := configstore.LockOrgConnectionAdmissionTx(tx, name); err != nil { |
| 332 | return err |
| 333 | } |
| 334 | result := tx.Model(&configstore.Org{}).Where("name = ?", name).Updates(fields) |
| 335 | if result.Error != nil { |
| 336 | return result.Error |
| 337 | } |
| 338 | found = result.RowsAffected > 0 |
| 339 | return nil |
| 340 | }) |
| 341 | if err != nil { |
| 342 | return nil, false, err |
| 343 | } |
| 344 | if !found { |
| 345 | return nil, false, nil |
| 346 | } |
| 347 | org, err := s.GetOrg(name) |
| 348 | if err != nil { |
| 349 | return nil, true, err |
| 350 | } |
| 351 | return org, true, nil |
| 352 | } |
| 353 | |
| 354 | func (s *gormAPIStore) DeleteOrg(name string) (bool, error) { |
| 355 | returnRows := int64(0) |
nothing calls this directly
no test coverage detected