on main help sign in
remove timeout on permission
90ce773Raphael Amorim
internal/permission/permission.go+1−8
@@ -1,12 +1,10 @@
1package permission
1package permission
2
2
3import (
3import (
4− "context"
5 "errors"
4 "errors"
6 "path/filepath"
5 "path/filepath"
7 "slices"
6 "slices"
8 "sync"
7 "sync"
9− "time"
10
8
11 "github.com/charmbracelet/crush/internal/config"
9 "github.com/charmbracelet/crush/internal/config"
12 "github.com/charmbracelet/crush/internal/pubsub"
10 "github.com/charmbracelet/crush/internal/pubsub"
@@ -117,15 +115,10 @@ func (s *permissionService) Request(opts CreatePermissionRequest) bool {
117
115
118 s.Publish(pubsub.CreatedEvent, permission)
116 s.Publish(pubsub.CreatedEvent, permission)
119
117
120− // Wait for the response with a timeout to prevent indefinite blocking
118+ // Wait for the response indefinitely
121− ctx, cancel := context.WithTimeout(context.Background(), 3*time.Minute)
122− defer cancel()
123−
124 select {
119 select {
125 case resp := <-respCh:
120 case resp := <-respCh:
126 return resp
121 return resp
127− case <-ctx.Done():
128− return false // Timeout - deny by default
129 }
122 }
130}
123}
131
124