mirror of
https://github.com/discourse/discourse.git
synced 2025-01-01 16:23:45 +08:00
FIX: we introduced a Jobs::UserEmail which broke consistency checks (#30409)
Fix ensures all classes are rooted and there is a spec that will catch failures next time
This commit is contained in:
parent
268d4d4fb9
commit
3fd3a76422
|
@ -8,23 +8,26 @@ module Jobs
|
|||
def execute(args)
|
||||
start_measure
|
||||
|
||||
# we don't want to have a situation where Jobs::Badge or stuff like that is attempted to be run
|
||||
# so we always prefix with :: to ensure we are running models
|
||||
|
||||
[
|
||||
UserVisit,
|
||||
Group,
|
||||
Notification,
|
||||
TopicFeaturedUsers,
|
||||
PostRevision,
|
||||
Topic,
|
||||
Badge,
|
||||
CategoryUser,
|
||||
UserOption,
|
||||
Tag,
|
||||
CategoryTagStat,
|
||||
User,
|
||||
UserAvatar,
|
||||
UserEmail,
|
||||
Category,
|
||||
TopicThumbnail,
|
||||
::UserVisit,
|
||||
::Group,
|
||||
::Notification,
|
||||
::TopicFeaturedUsers,
|
||||
::PostRevision,
|
||||
::Topic,
|
||||
::Badge,
|
||||
::CategoryUser,
|
||||
::UserOption,
|
||||
::Tag,
|
||||
::CategoryTagStat,
|
||||
::User,
|
||||
::UserAvatar,
|
||||
::UserEmail,
|
||||
::Category,
|
||||
::TopicThumbnail,
|
||||
].each do |klass|
|
||||
klass.ensure_consistency!
|
||||
measure(klass)
|
||||
|
|
9
spec/jobs/ensure_db_consistency_spec.rb
Normal file
9
spec/jobs/ensure_db_consistency_spec.rb
Normal file
|
@ -0,0 +1,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe Jobs::EnsureDbConsistency do
|
||||
subject(:job) { described_class.new }
|
||||
|
||||
it "is able to complete with no errors" do
|
||||
job.execute({})
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user