diff --git a/lib/embeddings/vector_representations/base.rb b/lib/embeddings/vector_representations/base.rb index fc944cf0..61c24789 100644 --- a/lib/embeddings/vector_representations/base.rb +++ b/lib/embeddings/vector_representations/base.rb @@ -85,7 +85,15 @@ module DiscourseAi ).first existing_lists = existing_index.match(/lists='(\d+)'/)&.captures&.first&.to_i - if existing_index_age > 0 && existing_index_age < 1.hour.ago.to_i + if existing_index_age > 0 && + existing_index_age < + ( + if SiteSetting.ai_embeddings_semantic_related_topics_enabled + 1.hour.ago.to_i + else + 1.day.ago.to_i + end + ) if new_rows > 10_000 Rails.logger.info( "Index #{index_name} is #{existing_index_age} seconds old, and there are #{new_rows} new rows, updating...",