diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2021-01-19 21:17:06 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2021-01-19 21:17:06 +0300 |
commit | f0f0f2af00e8b73a7013c1308289795961b23f4b (patch) | |
tree | 3dbe1760d7abd3050b3318e74d933edb9c6deb2e | |
parent | 7f07909a7b56eb368b3f8aab4752def1551c12fe (diff) | |
download | pleroma-f0f0f2af00e8b73a7013c1308289795961b23f4b.tar.gz pleroma-f0f0f2af00e8b73a7013c1308289795961b23f4b.zip |
[#3213] `timeout` option for `HashtagsTableMigrator.count/_`.
-rw-r--r-- | lib/pleroma/migrators/hashtags_table_migrator.ex | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pleroma/migrators/hashtags_table_migrator.ex b/lib/pleroma/migrators/hashtags_table_migrator.ex index 048f3c8ee..6a6a7b5b8 100644 --- a/lib/pleroma/migrators/hashtags_table_migrator.ex +++ b/lib/pleroma/migrators/hashtags_table_migrator.ex @@ -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 |