Skip to content
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

Open
mortelli opened this issue May 12, 2020 · 0 comments
Open

remove redundancy in target extraction from publisher #2181

mortelli opened this issue May 12, 2020 · 0 comments
Assignees
Labels
global pinning experimental implementation of global pinning

Comments

@mortelli
Copy link
Contributor

mortelli commented May 12, 2020

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 the Owner field based on the publisher var owner is not publisher
  • query the related feed and extract the targets
  • register these targets in memory for later re-use

In this manner, the calculations from publisher to targets 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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
global pinning experimental implementation of global pinning
Projects
None yet
Development

No branches or pull requests

2 participants