Skip to content

Commit

Permalink
discard metadata URL based on their hash, not URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
KtorZ committed Jun 27, 2020
1 parent d1d635f commit 149c2a0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/core/src/Cardano/Pool/DB/Sqlite.hs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ newDBLayer trace fp = do
, unfetchedPoolMetadataRefs = \limit -> do
let nLimit = T.pack (show limit)
let metadataHash = fieldName (DBField PoolRegistrationMetadataHash)
let metadataUrl = fieldName (DBField PoolRegistrationMetadataUrl)
let retryAfter = fieldName (DBField PoolFetchAttemptsRetryAfter)
let registrations = tableName (DBField PoolRegistrationMetadataHash)
let fetchAttempts = tableName (DBField PoolFetchAttemptsMetadataHash)
Expand All @@ -273,9 +272,9 @@ newDBLayer trace fp = do
, "FROM", metadata
, ")"
, "AND"
, metadataUrl, "NOT", "IN" -- Recently failed urls
, metadataHash, "NOT", "IN" -- Recently failed urls
, "("
, "SELECT", metadataUrl
, "SELECT", metadataHash
, "FROM", fetchAttempts
, "WHERE", retryAfter, ">=", "datetime('now')"
, ")"
Expand Down

0 comments on commit 149c2a0

Please sign in to comment.