修复更新节点时并发导致的分配失败问题
This commit is contained in:
@@ -20,7 +20,7 @@ func FindCitiesWithEdgesCount(tx *gorm.DB) ([]model.City, error) {
|
||||
model.City
|
||||
EdgesCount int `gorm:"column:edges_count"`
|
||||
}
|
||||
err := tx.Debug().
|
||||
err := tx.
|
||||
Select("cityhash.*, COUNT(edge.id) AS edges_count").
|
||||
Joins("LEFT JOIN edge ON edge.city_id = cityhash.id").
|
||||
Where("cityhash.label IS NOT NULL").
|
||||
|
||||
Reference in New Issue
Block a user