feat(updater): log warning about using -minratio

This commit is contained in:
Quentin McGaw
2023-09-24 15:05:39 +00:00
parent b787e12e25
commit dc8fc5f81f

View File

@@ -7,6 +7,7 @@ import (
"fmt"
"github.com/qdm12/gluetun/internal/models"
"github.com/qdm12/gluetun/internal/provider/common"
)
type Provider interface {
@@ -23,6 +24,10 @@ func (u *Updater) updateProvider(ctx context.Context, provider Provider,
minServers := int(minRatio * float64(existingServersCount))
servers, err := provider.FetchServers(ctx, minServers)
if err != nil {
if errors.Is(err, common.ErrNotEnoughServers) {
u.logger.Warn("note: if running the update manually, you can use the flag " +
"-minratio to allow the update to succeed with less servers found")
}
return fmt.Errorf("getting servers: %w", err)
}