Limit number of items in initial sync
This commit is contained in:
parent
3129142274
commit
52c6f1ff6c
|
@ -146,7 +146,13 @@ defmodule FrenzyWeb.Fervor.ItemsController do
|
|||
{deleted_ids, upserted} =
|
||||
case last_sync do
|
||||
nil ->
|
||||
items = Repo.all(from i in Item, where: not i.tombstone and i.feed_id in ^feed_ids)
|
||||
items =
|
||||
Item
|
||||
|> where([i], not i.tombstone and i.feed_id in ^feed_ids)
|
||||
|> order_by([i], desc: i.inserted_at)
|
||||
|> limit(1000)
|
||||
|> Repo.all()
|
||||
|
||||
{[], items}
|
||||
|
||||
_ ->
|
||||
|
|
Loading…
Reference in New Issue