Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Go: run first scheduled task immediately on Start instead of waiting one Interval (#20714)

Jin Hai2f7f2e0a3375
diff --git a/internal/utility/scheduled_task.go b/internal/utility/scheduled_task.go
index bcf7bcd644..8ba7b51da4 100644
--- a/internal/utility/scheduled_task.go
+++ b/internal/utility/scheduled_task.go
@@ -57,6 +57,8 @@ func (t *ScheduledTask) Start() {
t.running = true
t.mu.Unlock()
+ t.runSafely()
+
go func(stop <-chan struct{}) {
ticker := time.NewTicker(t.Interval)
defer ticker.Stop()