FIX: Shutdown embeddings thread pool after processing (#961)

This commit is contained in:
Roman Rizzi 2024-11-26 18:12:03 -03:00 committed by GitHub
parent ef07fcb308
commit 251628bfa1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -81,6 +81,9 @@ module DiscourseAi
.zip(*promised_embeddings) .zip(*promised_embeddings)
.value! .value!
.each { |e| save_to_db(e[:target], e[:embedding], e[:digest]) } .each { |e| save_to_db(e[:target], e[:embedding], e[:digest]) }
pool.shutdown
pool.wait_for_termination
end end
def generate_representation_from(target, persist: true) def generate_representation_from(target, persist: true)