summaryrefslogtreecommitdiff
path: root/internal/server/handlers/basehandler.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/server/handlers/basehandler.go')
-rw-r--r--internal/server/handlers/basehandler.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/server/handlers/basehandler.go b/internal/server/handlers/basehandler.go
index 427ab6c..3bb824b 100644
--- a/internal/server/handlers/basehandler.go
+++ b/internal/server/handlers/basehandler.go
@@ -409,6 +409,20 @@ func (h *baseHandler) shutdown() {
h.flushTurboData()
}
+ // Shutdown aggregates BEFORE flush to ensure MapReduce data is available
+ if h.turboAggregate != nil {
+ dlog.Server.Info(h.user, "Shutting down turbo aggregate in shutdown()")
+ h.turboAggregate.Shutdown()
+ // Give time for serialization to complete
+ time.Sleep(100 * time.Millisecond)
+ }
+ if h.aggregate != nil {
+ dlog.Server.Info(h.user, "Shutting down regular aggregate in shutdown()")
+ h.aggregate.Shutdown()
+ // Give time for serialization to complete
+ time.Sleep(100 * time.Millisecond)
+ }
+
h.flush()
go func() {