on main help sign in
remove timeout on permission
commit90ce773e8562cf1ceec5d861ea9af54f2613ac93 authorRaphael Amorim <rapha850@gmail.com> dateTue 24 Jun 2025, 19:52 (1 year ago) parentf1117af
1 file changed+1−8
internal/permission/permission.go+1−8
internal/permission/permission.go+1−8
@@ -1,12 +1,10 @@
11package permission
22
33import (
4− "context"
54 "errors"
65 "path/filepath"
76 "slices"
87 "sync"
9− "time"
108
119 "github.com/charmbracelet/crush/internal/config"
1210 "github.com/charmbracelet/crush/internal/pubsub"
@@ -117,15 +115,10 @@ func (s *permissionService) Request(opts CreatePermissionRequest) bool {
117115
118116 s.Publish(pubsub.CreatedEvent, permission)
119117
120− // Wait for the response with a timeout to prevent indefinite blocking
121− ctx, cancel := context.WithTimeout(context.Background(), 3*time.Minute)
122− defer cancel()
123−
118+ // Wait for the response indefinitely
124119 select {
125120 case resp := <-respCh:
126121 return resp
127− case <-ctx.Done():
128− return false // Timeout - deny by default
129122 }
130123}
131124