File tree Expand file tree Collapse file tree 4 files changed +14
-1
lines changed
Expand file tree Collapse file tree 4 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -22,3 +22,6 @@ DEBUG_ERRORS=true
2222TRACKER_API_URL = http://localhost:3030
2323
2424MAX_BATCH_SIZE = 268435456 # 256 MiB
25+
26+ # Time we wait for a batch to be verified before marking it stale
27+ BATCH_TTL_MINUTES = 5
Original file line number Diff line number Diff line change @@ -20,3 +20,6 @@ DEBUG_ERRORS=<true|false>
2020
2121# Tracker API
2222TRACKER_API_URL = <tracker_api_url>
23+
24+ # Time we wait for a batch to be verified before marking it stale
25+ BATCH_TTL_MINUTES = 5
Original file line number Diff line number Diff line change @@ -148,7 +148,8 @@ defmodule ExplorerWeb.Helpers do
148148 end
149149
150150 def is_stale? ( batch ) do
151- DateTime . add ( batch . submission_timestamp , 5 , :minute )
151+ ttl = Utils . batch_ttl_minutes ( )
152+ DateTime . add ( batch . submission_timestamp , ttl , :minute )
152153 |> DateTime . before? ( DateTime . utc_now ( ) )
153154 end
154155
@@ -297,6 +298,11 @@ defmodule Utils do
297298 end
298299 end
299300
301+ def batch_ttl_minutes ( ) do
302+ System . get_env ( "BATCH_TTL_MINUTES" )
303+ |> String . to_integer ( )
304+ end
305+
300306 def process_batch ( % BatchDB { } = batch ) do
301307 case get_proof_hashes ( batch ) do
302308 { :ok , proof_hashes } ->
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ env_vars=(
1515 " DEBUG_ERRORS"
1616 " TRACKER_API_URL"
1717 " MAX_BATCH_SIZE"
18+ " BATCH_TTL_MINUTES"
1819)
1920
2021for var in " ${env_vars[@]} " ; do
You can’t perform that action at this time.
0 commit comments