mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 12:37:49 +00:00
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:
@@ -33,7 +33,6 @@ type RemoteFS struct {
|
||||
FetchChannel chan *RemoteFile
|
||||
remoteErrors []error
|
||||
logger *slog.Logger
|
||||
defaultClient *http.Client
|
||||
extractedFiles map[string]RolodexFile
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user