refac: atomic merge, lost-update race, RunPurge cost, duplicated walks

This commit is contained in:
Florian Sylvain committed 2026-10-21 22:47:46 +02:00
1 parent 0fc3511e2b
commit 074944c99a
45 files changed
+2204 -267

No files matched your search

+6
View File
@@ -25,6 +25,8 @@ type mockArticleRepo struct {
authors *mockAuthorRepo
reportSlugRace bool
createAlwaysRaces bool
afterFindByBody func()
updateBodyIDs []uint32
}
func newMockArticleRepo() *mockArticleRepo {
@@ -315,6 +317,7 @@ func (m *mockArticleRepo) Create(a article.Article) (article.Article, error) {
}
func (m *mockArticleRepo) UpdateBody(id uint32, body string) (article.Article, error) {
m.updateBodyIDs = append(m.updateBodyIDs, id)
if err := m.fail.trigger("UpdateBody"); err != nil {
return article.Article{}, err
}
@@ -427,6 +430,9 @@ func (m *mockArticleRepo) FindByBodyContaining(filename string) ([]article.Artic
result = append(result, a)
}
}
if m.afterFindByBody != nil {
defer m.afterFindByBody()
}
return result, nil
}