Fixed runaway rolodex.

The rolodex was running away and locking up vacuum.

Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
quobix
2024-01-31 15:15:24 -08:00
parent c55527066a
commit a24c05036b
4 changed files with 13 additions and 2 deletions

View File

@@ -284,6 +284,11 @@ func (i *RemoteFS) Open(remoteURL string) (fs.File, error) {
"AllowRemoteLookup to true as part of the index configuration", remoteURL)
}
if !strings.HasPrefix(remoteURL, "http") {
i.logger.Debug("[rolodex remote loader] not a remote file, ignoring", "file", remoteURL)
return nil, nil
}
remoteParsedURL, err := url.Parse(remoteURL)
if err != nil {
return nil, err
@@ -306,6 +311,7 @@ func (i *RemoteFS) Open(remoteURL string) (fs.File, error) {
"remoteURL", remoteParsedURL.String())
for !wait.done {
i.logger.Debug("[rolodex remote loader] sleeping, waiting for file to return", "file", remoteURL)
time.Sleep(500 * time.Nanosecond) // breathe for a few nanoseconds.
}