Skip to content

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

add sync audit hook (#21901)

Jin Haic3437289eb2f
diff --git a/cmd/ragflow_server.go b/cmd/ragflow_server.go
index f71bdacd0a..6162df8314 100644
--- a/cmd/ragflow_server.go
+++ b/cmd/ragflow_server.go
@@ -466,6 +466,9 @@ func main() {
common.Error("Failed to initialize audit logger", err)
os.Exit(1)
}
+ defer func() {
+ common.SyncAudit()
+ }()
// set server name and log file path
server.SetServerName(serverName)
diff --git a/internal/common/stub.go b/internal/common/stub.go
index 0334a1184f..f39de5b591 100644
--- a/internal/common/stub.go
+++ b/internal/common/stub.go
@@ -61,6 +61,9 @@ type OperationLog struct {
func Audit(operationLog *OperationLog, fields ...zap.Field) {
}
+func SyncAudit() {
+}
+
// ingestLogger receives the serialized ingest events. It defaults to a no-op so a
// binary that never calls InitIngestLog emits nothing and never panics.
var ingestLogger atomic.Pointer[zap.Logger]