Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 48f6956

Browse files
committed
fix tests, rename setting 7
1 parent fb9394b commit 48f6956

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

app/jobs/scheduled/summaries_backfill.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ def execute(_args)
1919
DiscourseAi::Summarization.topic_summary(topic).force_summarize(system_user)
2020
end
2121

22+
return unless SiteSetting.ai_summary_gists_enabled
23+
2224
gist_t = AiSummary.summary_types[:gist]
2325
backfill_candidates(gist_t)
2426
.limit(current_budget(gist_t))
@@ -29,9 +31,9 @@ def backfill_candidates(summary_type)
2931
Topic
3032
.where("topics.word_count >= ?", SiteSetting.ai_summary_backfill_minimum_word_count)
3133
.joins(<<~SQL)
32-
LEFT OUTER JOIN ai_summaries ais ON
33-
topics.id = ais.target_id AND
34-
ais.target_type = 'Topic' AND
34+
LEFT OUTER JOIN ai_summaries ais ON
35+
topics.id = ais.target_id AND
36+
ais.target_type = 'Topic' AND
3537
ais.summary_type = '#{summary_type}'
3638
SQL
3739
.where(

db/migrate/20241126033812_rename_ai_gist_batch_setting.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
class RenameAiGistBatchSetting < ActiveRecord::Migration[7.0]
44
def up
5+
execute "UPDATE site_settings SET name = 'ai_summary_gists_enabled', value = 't', data_type = 5 WHERE name = 'ai_summarize_max_topic_gists_per_batch'"
56
execute "UPDATE site_settings SET name = 'ai_summary_gists_allowed_groups' WHERE name = 'ai_hot_topic_gists_allowed_groups'"
67
end
78

89
def down
10+
execute "UPDATE site_settings SET name = 'ai_summarize_max_topic_gists_per_batch', value = '10', data_type = 3 WHERE name = 'ai_summary_gists_enabled'"
911
execute "UPDATE site_settings SET name = 'ai_hot_topic_gists_allowed_groups' WHERE name = 'ai_summary_gists_allowed_groups'"
1012
end
1113
end

0 commit comments

Comments
 (0)