This repository has been archived by the owner on Aug 2, 2021. It is now read-only.
remove redundancy in target extraction from publisher #2181
Labels
global pinning
experimental implementation of global pinning
As it is, the content recovery hook is working out targets—based on the publisher in the manifest—for each chunk that needs to be repaired.
This is inefficient, as the owner will be determined (plus its feed queried) each time a chunk for the same publisher is attempted to be recovered.
Rather than a feeds handler, the recovery hook should use a
struct
which gets and sets known targets for any given publisher.This struct would:
work out theowner is not publisherOwner
field based on thepublisher
vartargets
In this manner, the calculations from
publisher
totargets
will be done only once per publisher.With each subsequent call, the hook would then consult this struct to get the target list and avoid repeated operations & queries.
As a result, the injection of the publisher in the context should be replaced with the injection of the targets instead.
Additionally, check if
lookup.NoClue
could be replaced with something smarter once we know when the last update happened for a feed.The text was updated successfully, but these errors were encountered: