Skip packages without description text in vectorization
Packages with neither description nor long description cannot be embedded at all; they used to fail on every run. Exclude them from the scope instead.
This commit is contained in:
parent
2b79470feb
commit
bada261841
1 changed files with 5 additions and 1 deletions
|
|
@ -11,7 +11,11 @@ namespace :debshots do
|
||||||
logger.level = Logger::INFO
|
logger.level = Logger::INFO
|
||||||
|
|
||||||
force = ENV['FORCE'].present?
|
force = ENV['FORCE'].present?
|
||||||
scope = force ? Package.all : Package.where(embedding: nil)
|
# Packages without any description text cannot be embedded at all -
|
||||||
|
# exclude them so they do not fail on every single run.
|
||||||
|
base_scope = Package.where("COALESCE(description, '') <> '' OR " \
|
||||||
|
"COALESCE(long_description, '') <> ''")
|
||||||
|
scope = force ? base_scope : base_scope.where(embedding: nil)
|
||||||
total = scope.count
|
total = scope.count
|
||||||
|
|
||||||
if total.zero?
|
if total.zero?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue