discourse-ai/app/jobs/scheduled/category_localization_backfill.rb

17 lines
404 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
module Jobs
class CategoryLocalizationBackfill < ::Jobs::Scheduled
every 12.hours
cluster_concurrency 1
def execute(args)
return if !SiteSetting.discourse_ai_enabled
return if !SiteSetting.ai_translation_enabled
return if SiteSetting.content_localization_supported_locales.blank?
Jobs.enqueue(:localize_categories)
end
end
end