fix accidental break of mastodon crawler

This commit is contained in:
Tao Bror Bojlén 2019-08-06 21:58:02 +03:00
parent decdadf76e
commit e4f98a2b2f
No known key found for this signature in database
GPG key ID: C6EC7AAB905F9E6F
2 changed files with 4 additions and 3 deletions

View file

@ -40,7 +40,7 @@ defmodule Backend.Api do
|> where( |> where(
[i], [i],
not is_nil(i.x) and not is_nil(i.y) and not is_nil(i.user_count) and not is_nil(i.x) and not is_nil(i.y) and not is_nil(i.user_count) and
i.user_count >= ^user_threshold and not i.opt_out (i.user_count >= ^user_threshold or i.opt_in) and not i.opt_out
) )
|> maybe_filter_nodes_to_neighborhood(domain) |> maybe_filter_nodes_to_neighborhood(domain)
|> select([c], [:domain, :user_count, :x, :y, :type, :statuses_per_day]) |> select([c], [:domain, :user_count, :x, :y, :type, :statuses_per_day])
@ -79,7 +79,8 @@ defmodule Backend.Api do
[e, i1, i2], [e, i1, i2],
not is_nil(i1.x) and not is_nil(i1.y) and not is_nil(i1.x) and not is_nil(i1.y) and
not is_nil(i2.x) and not is_nil(i2.y) and not is_nil(i2.x) and not is_nil(i2.y) and
i1.user_count >= ^user_threshold and i2.user_count >= ^user_threshold and (i1.user_count >= ^user_threshold or i1.opt_in) and
(i2.user_count >= ^user_threshold or i2.opt_in) and
not i1.opt_out and not i2.opt_out not i1.opt_out and not i2.opt_out
) )
|> Repo.all() |> Repo.all()

View file

@ -1,6 +1,6 @@
defmodule Backend.Crawler.Util do defmodule Backend.Crawler.Util do
require Logger require Logger
alias Backend.Repo alias Backend.{Instance, Repo}
import Backend.Util import Backend.Util
import Ecto.Query import Ecto.Query