mirror of
https://github.com/anotherhadi/iknowyou.git
synced 2026-04-11 16:37:25 +02:00
Pin the search in demo mode
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
@@ -21,6 +21,7 @@ func (m *Manager) InjectDemoSearches() {
|
||||
InputType: tools.InputTypeEmail,
|
||||
Profile: "default",
|
||||
StartedAt: now.Add(-2 * time.Hour),
|
||||
pinned: true,
|
||||
PlannedTools: []ToolStatus{
|
||||
{Name: "user-scanner", ResultCount: ptr(10)},
|
||||
{Name: "github-recon", ResultCount: ptr(3)},
|
||||
@@ -77,6 +78,7 @@ func (m *Manager) InjectDemoSearches() {
|
||||
InputType: tools.InputTypeUsername,
|
||||
Profile: "default",
|
||||
StartedAt: now.Add(-30 * time.Minute),
|
||||
pinned: true,
|
||||
PlannedTools: []ToolStatus{
|
||||
{Name: "user-scanner", ResultCount: ptr(10)},
|
||||
{Name: "github-recon", ResultCount: ptr(0)},
|
||||
|
||||
@@ -131,6 +131,9 @@ func (m *Manager) purgeExpired() {
|
||||
m.mu.Lock()
|
||||
defer m.mu.Unlock()
|
||||
for id, s := range m.searches {
|
||||
if s.pinned {
|
||||
continue // demo/pinned searches are never purged
|
||||
}
|
||||
ft := s.FinishedAt()
|
||||
if ft.IsZero() {
|
||||
continue // still running
|
||||
|
||||
@@ -32,6 +32,7 @@ type Search struct {
|
||||
PlannedTools []ToolStatus
|
||||
|
||||
cancelFn context.CancelFunc
|
||||
pinned bool // if true, never purged by the cleanup loop
|
||||
|
||||
mu sync.RWMutex
|
||||
events []tools.Event
|
||||
|
||||
Reference in New Issue
Block a user