Merge pull request #2682 from poanetwork/pp-fix-cache-task

Use Task.start instead of Task.async in caches
pull/2690/head
Victor Baranov 5 years ago committed by GitHub
commit 6051e9d6fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 4
      apps/explorer/lib/explorer/chain/cache/block_count.ex
  3. 4
      apps/explorer/lib/explorer/chain/cache/transaction_count.ex

@ -5,6 +5,7 @@
- [#2672](https://github.com/poanetwork/blockscout/pull/2672) - added new theme for xUSDT
### Fixes
- [#2682](https://github.com/poanetwork/blockscout/pull/2682) - Use Task.start instead of Task.async in caches
### Chore

@ -28,8 +28,8 @@ defmodule Explorer.Chain.Cache.BlockCount do
defp handle_fallback(:async_task) do
# If this gets called it means an async task was requested, but none exists
# so a new one needs to be launched
task =
Task.async(fn ->
{:ok, task} =
Task.start(fn ->
try do
result = Chain.fetch_count_consensus_block()

@ -29,8 +29,8 @@ defmodule Explorer.Chain.Cache.TransactionCount do
defp handle_fallback(:async_task) do
# If this gets called it means an async task was requested, but none exists
# so a new one needs to be launched
task =
Task.async(fn ->
{:ok, task} =
Task.start(fn ->
try do
result = Repo.aggregate(Transaction, :count, :hash, timeout: :infinity)

Loading…
Cancel
Save