You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now the indexer "query" is done on every request... it would be better to have it as a query...
Instead of
Episode.all.eachdo |episode|
ifepisde....end
Episode.not_indexed.eachdo |episode|
...
end
where Episode.not_indexed is:
class Episode
scope :not_indexed -> { where(indexed: nil).or(....) }
end
```
That improves the performance because it does not fetch all episodes from mongo to ruby's memory so it can run against the if-else.
(Add a mongo-index to `updated_at` && `indexed_at` so it can run faster)
The text was updated successfully, but these errors were encountered:
Right now the indexer "query" is done on every request... it would be better to have it as a query...
Instead of
where
Episode.not_indexed
is:The text was updated successfully, but these errors were encountered: