diff --git a/models/action.go b/models/action.go index 8b077e6ca..e2958821c 100755 --- a/models/action.go +++ b/models/action.go @@ -354,7 +354,7 @@ func GetLast20PublicFeeds() ([]*Action, error) { actions := make([]*Action, 0, 20) - if err := x.Limit(20).Desc("id").Where(cond).Find(&actions); err != nil { + if err := x.Limit(30).Desc("id").Where(cond).Find(&actions); err != nil { return nil, fmt.Errorf("Find: %v", err) } diff --git a/services/socketwrap/clientManager.go b/services/socketwrap/clientManager.go index 7692c815e..eeb496108 100644 --- a/services/socketwrap/clientManager.go +++ b/services/socketwrap/clientManager.go @@ -26,7 +26,7 @@ func NewClientsManager() *ClientsManager { const MaxClients = 100 -var LastActionsQueue = NewSyncQueue(11) +var LastActionsQueue = NewSyncQueue(15) func (h *ClientsManager) Run() { initActionQueue() @@ -75,7 +75,15 @@ func initActionQueue() { actions, err := models.GetLast20PublicFeeds() if err == nil { for i := len(actions) - 1; i >= 0; i-- { - LastActionsQueue.Push(actions[i]) + + user, err := models.GetUserByID(actions[i].UserID) + if err == nil { + if !user.IsOrganization() { + LastActionsQueue.Push(actions[i]) + } + + } + } } }