mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-26 18:59:08 -06:00
go: dsess: autoincrement_tracker.go: Only do gc lifecycle events if a safepoint controller exists.
This commit is contained in:
@@ -68,11 +68,17 @@ func NewAutoIncrementTracker(ctx context.Context, dbName string, roots ...doltdb
|
||||
mm: mutexmap.NewMutexMap(),
|
||||
init: make(chan struct{}),
|
||||
}
|
||||
ctx = gcctx.WithGCSafepointController(context.Background(), getGCSafepointController(ctx))
|
||||
ctx = context.Background()
|
||||
gcSafepointController := getGCSafepointController(ctx)
|
||||
if gcSafepointController != nil {
|
||||
ctx = gcctx.WithGCSafepointController(ctx, gcSafepointController)
|
||||
}
|
||||
go func() {
|
||||
defer gcctx.SessionEnd(ctx)
|
||||
gcctx.SessionCommandBegin(ctx)
|
||||
defer gcctx.SessionCommandEnd(ctx)
|
||||
if gcSafepointController != nil {
|
||||
defer gcctx.SessionEnd(ctx)
|
||||
gcctx.SessionCommandBegin(ctx)
|
||||
defer gcctx.SessionCommandEnd(ctx)
|
||||
}
|
||||
ait.runInitWithRootsAsync(ctx, roots...)
|
||||
}()
|
||||
return &ait, nil
|
||||
|
||||
Reference in New Issue
Block a user