File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -43,23 +43,22 @@ func (l *Library) Init() tea.Cmd {
4343}
4444
4545func (l * Library ) setVisibleExecs () {
46+ l .mu .RLock ()
4647 if len (l .allExecutables ) == 0 || len (l .visibleWorkspaces ) == 0 {
48+ l .mu .RUnlock ()
4749 return
4850 }
4951
5052 curWs := l .filter .Workspace
5153
52- l .mu .RLock ()
5354 if label := l .visibleWorkspaces [l .currentWorkspace ]; label != "" && label != allWorkspacesLabel {
5455 curWs = label
5556 } else if curWs == allWorkspacesLabel {
5657 curWs = ""
5758 }
58- l .mu .RUnlock ()
5959
6060 curNs := l .filter .Namespace
6161 if l .showNamespaces && len (l .visibleNamespaces ) > 0 {
62- l .mu .RLock ()
6362 if label := l .visibleNamespaces [l .currentNamespace ]; label != "" {
6463 switch label {
6564 case withoutNamespaceLabel :
@@ -70,8 +69,8 @@ func (l *Library) setVisibleExecs() {
7069 curNs = label
7170 }
7271 }
73- l .mu .RUnlock ()
7472 }
73+ l .mu .RUnlock ()
7574
7675 filter := l .filter
7776 filteredExec := l .allExecutables
@@ -127,15 +126,16 @@ func (l *Library) setVisibleWorkspaces() {
127126}
128127
129128func (l * Library ) setVisibleNamespaces () {
129+ l .mu .RLock ()
130130 if l .allExecutables == nil || len (l .visibleWorkspaces ) == 0 {
131+ l .mu .RUnlock ()
131132 return
132133 }
133134
134135 var labels , prepend []string
135136 var someWithoutNs bool
136137 filter := l .filter
137138
138- l .mu .RLock ()
139139 filterWs := l .visibleWorkspaces [l .currentWorkspace ]
140140 l .mu .RUnlock ()
141141
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ func RequestExecWithTransform(opts ...Option) *executable.Executable {
6969 Request : & executable.RequestExecutableType {
7070 URL : "https://httpbin.org/get" ,
7171 TransformResponse : "status" ,
72+ ValidStatusCodes : []int {200 , 503 }, // TODO: use a mock server to avoid relying on external services
7273 },
7374 }
7475 if len (opts ) > 0 {
You can’t perform that action at this time.
0 commit comments