outpost: fix 100% CPU Usage when not connected to websocket
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
aca3a5c458
commit
f6e1bfdfc8
|
@ -213,6 +213,6 @@ class UserViewSet(UsedByMixin, ModelViewSet):
|
|||
return queryset
|
||||
|
||||
def filter_queryset(self, queryset):
|
||||
if self.request.user.has_perm("authentik_core.view_group"):
|
||||
if self.request.user.has_perm("authentik_core.view_user"):
|
||||
return self._filter_queryset_for_list(queryset)
|
||||
return super().filter_queryset(queryset)
|
||||
|
|
|
@ -71,14 +71,12 @@ func (ac *APIController) Shutdown() {
|
|||
func (ac *APIController) startWSHandler() {
|
||||
logger := ac.logger.WithField("loop", "ws-handler")
|
||||
for {
|
||||
if !ac.wsConn.IsConnected() {
|
||||
continue
|
||||
}
|
||||
var wsMsg websocketMessage
|
||||
err := ac.wsConn.ReadJSON(&wsMsg)
|
||||
if err != nil {
|
||||
logger.WithError(err).Warning("ws write error, reconnecting")
|
||||
ac.wsConn.CloseAndReconnect()
|
||||
time.Sleep(time.Second * 5)
|
||||
continue
|
||||
}
|
||||
if wsMsg.Instruction == WebsocketInstructionTriggerUpdate {
|
||||
|
|
|
@ -32,6 +32,10 @@ slug: "2021.7"
|
|||
- root: subclass SessionMiddleware to set Secure and SameSite flag depending on context
|
||||
- web: fix error when showing error message of request
|
||||
|
||||
## Fixed in 2021.7.1-rc2
|
||||
|
||||
- outpost: fix 100% CPU Usage when not connected to websocket
|
||||
|
||||
## Upgrading
|
||||
|
||||
This release does not introduce any new requirements.
|
||||
|
|
Reference in New Issue