Removed some dead code that does not need to exist

A consequence of the old index design, now gone

Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
quobix
2023-11-01 13:07:53 -04:00
parent 33fc552c65
commit 2bc3c67776
3 changed files with 504 additions and 527 deletions

View File

@@ -33,7 +33,6 @@ type RemoteFS struct {
FetchChannel chan *RemoteFile
remoteErrors []error
logger *slog.Logger
defaultClient *http.Client
extractedFiles map[string]RolodexFile
}

View File

@@ -246,7 +246,6 @@ func TestRemoteFS_SetRemoteHandler(t *testing.T) {
assert.NoError(t, y)
assert.NotNil(t, x.RemoteHandlerFunc)
cf = CreateClosedAPIIndexConfig()
assert.NotNil(t, x.RemoteHandlerFunc)
x.SetRemoteHandlerFunc(h)

View File

@@ -650,29 +650,8 @@ func (index *SpecIndex) GetGlobalCallbacksCount() int {
// look through method for callbacks
callbacks, _ := yamlpath.NewPath("$..callbacks")
// Channel used to receive the result from doSomething function
ch := make(chan string, 1)
// Create a context with a timeout of 5 seconds
ctxTimeout, cancel := context.WithTimeout(context.Background(), time.Millisecond*500)
defer cancel()
var res []*yaml.Node
doSomething := func(ctx context.Context, ch chan<- string) {
res, _ = callbacks.Find(m.Node)
ch <- m.Definition
}
// Start the doSomething function
go doSomething(ctxTimeout, ch)
select {
case <-ctxTimeout.Done():
fmt.Printf("Callback %d: Context cancelled: %v\n", m.Node.Line, ctxTimeout.Err())
case <-ch:
}
if len(res) > 0 {
for _, callback := range res[0].Content {
if utils.IsNodeMap(callback) {