Skip to content

Commit

Permalink
#1896 Limit number of flow element by age
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Mar 26, 2021
1 parent 824b55a commit 66cbe14
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion thehive/app/org/thp/thehive/services/FlowActor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package org.thp.thehive.services
import akka.actor.{Actor, ActorRef, ActorSystem, PoisonPill, Props}
import akka.cluster.singleton.{ClusterSingletonManager, ClusterSingletonManagerSettings, ClusterSingletonProxy, ClusterSingletonProxySettings}
import com.google.inject.Injector
import org.apache.tinkerpop.gremlin.process.traversal.Order
import org.apache.tinkerpop.gremlin.process.traversal.{Order, P}
import org.thp.scalligraph.auth.AuthContext
import org.thp.scalligraph.models.Database
import org.thp.scalligraph.services.EventSrv
Expand Down Expand Up @@ -61,6 +61,7 @@ class FlowActor extends Actor {
auditSrv
.startTraversal
.has(_.mainAction, true)
.has(_._createdAt, P.gt(fromDate))
.sort(_.by("_createdAt", Order.desc))
.visible(organisationSrv)
.limit(10)
Expand Down

0 comments on commit 66cbe14

Please sign in to comment.