From 081ff8bd938e651be901825b2f1f410eead17ab3 Mon Sep 17 00:00:00 2001 From: Fernando Bunn Date: Thu, 28 Nov 2024 12:23:56 -0300 Subject: [PATCH] Use 10min timer --- DuckDuckGo/AIChat/AIChatModel.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/DuckDuckGo/AIChat/AIChatModel.swift b/DuckDuckGo/AIChat/AIChatModel.swift index 6fd0dc00ec..54f7f0901c 100644 --- a/DuckDuckGo/AIChat/AIChatModel.swift +++ b/DuckDuckGo/AIChat/AIChatModel.swift @@ -34,14 +34,16 @@ final class AIChatModel { cleanupTimerCancellable?.cancel() } + /// Starts a 10-minute timer to trigger cleanup after AI Chat is closed. + /// Cancels any existing timer before starting a new one. func startCleanupTimer() { print("Start timer") cancelTimer() cleanupTimerCancellable = Just(()) - .delay(for: .seconds(5), scheduler: RunLoop.main) + .delay(for: .seconds(600), scheduler: RunLoop.main) .sink { [weak self] in self?.cleanupPublisher.send() } } -} +