fix(add): respect Provide config in fast-provide-root

fast-provide-root should honor the same config settings as the regular
provide system:
- skip when Provide.Enabled is false
- skip when Provide.DHT.Interval is 0
- respect Provide.Strategy (all/pinned/roots/mfs/combinations)

This ensures fast-provide only runs when appropriate based on user
configuration and the nature of the content being added (pinned vs
unpinned, added to MFS or not).
This commit is contained in:
Marcin Rataj 2025-11-14 00:12:27 +01:00
parent d56fe3a026
commit 5e6148bcf4

View File

@ -620,9 +620,11 @@ https://github.com/ipfs/kubo/blob/master/docs/config.md#import
// For combined strategies (pinned+mfs), check each component
if strategy&config.ProvideStrategyPinned != 0 && dopin {
shouldProvide = true
} else if strategy&config.ProvideStrategyRoots != 0 && dopin {
}
if strategy&config.ProvideStrategyRoots != 0 && dopin {
shouldProvide = true
} else if strategy&config.ProvideStrategyMFS != 0 && toFilesSet {
}
if strategy&config.ProvideStrategyMFS != 0 && toFilesSet {
shouldProvide = true
}
}