mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-18 21:09:25 +00:00
[#3213] timeout
option for HashtagsTableMigrator.count/_
.
This commit is contained in:
parent
7f07909a7b
commit
f0f0f2af00
|
@ -192,13 +192,13 @@ defmodule Pleroma.Migrators.HashtagsTableMigrator do
|
|||
end)
|
||||
end
|
||||
|
||||
def count(force \\ false) do
|
||||
def count(force \\ false, timeout \\ :infinity) do
|
||||
stored_count = state()[:count]
|
||||
|
||||
if stored_count && !force do
|
||||
stored_count
|
||||
else
|
||||
count = Repo.aggregate(query(), :count, :id)
|
||||
count = Repo.aggregate(query(), :count, :id, timeout: timeout)
|
||||
put_stat(:count, count)
|
||||
count
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue