mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 08:48:24 +08:00
14 lines
286 B
Ruby
14 lines
286 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Jobs
|
|
class DeleteUserMessages < ::Jobs::Base
|
|
def execute(args)
|
|
return if args[:user_id].nil?
|
|
|
|
ChatMessageDestroyer.new.destroy_in_batches(
|
|
ChatMessage.with_deleted.where(user_id: args[:user_id]),
|
|
)
|
|
end
|
|
end
|
|
end
|