Skip to content

Commit 7ac9651

Browse files
authored
Merge branch 'main' into activity-notifications
2 parents e3fd023 + 54e00af commit 7ac9651

File tree

27 files changed

+1563
-417
lines changed

27 files changed

+1563
-417
lines changed

config/config.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ config :algora, Oban,
3333
github_og_image: 5,
3434
notify_bounty: 1,
3535
notify_tip_intent: 1,
36+
notify_claim: 1,
3637
activity_notifier: 1,
3738
activity_mailer: 1
3839
]

lib/algora/accounts/accounts.ex

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -328,12 +328,15 @@ defmodule Algora.Accounts do
328328
end
329329

330330
def get_random_access_tokens(n) when is_integer(n) and n > 0 do
331-
Identity
332-
|> where([i], i.provider == "github" and not is_nil(i.provider_token))
333-
|> order_by(fragment("RANDOM()"))
334-
|> limit(^n)
335-
|> select([i], i.provider_token)
336-
|> Repo.all()
331+
case Identity
332+
|> where([i], i.provider == "github" and not is_nil(i.provider_token))
333+
|> order_by(fragment("RANDOM()"))
334+
|> limit(^n)
335+
|> select([i], i.provider_token)
336+
|> Repo.all() do
337+
[""] -> []
338+
tokens -> tokens
339+
end
337340
end
338341

339342
defp update_github_token(%User{} = user, new_token) do

0 commit comments

Comments
 (0)