add missing beginning and closing of session in migration

This commit is contained in:
David Schneiderbauer 2018-06-15 14:46:41 +02:00
parent fa758ae603
commit dcd1cba32f
No known key found for this signature in database
GPG Key ID: 576113B2803B3EAB

View File

@ -66,6 +66,10 @@ func removeStaleWatches(x *xorm.Engine) error {
}
sess := x.NewSession()
defer sess.Close()
if err := sess.Begin(); err != nil {
return err
}
repoCache := make(map[int64]*Repository)
err := x.BufferSize(setting.IterateBufferSize).Iterate(new(Watch),