Weekend fun with further optimisations.

This commit is contained in:
2025-09-13 23:42:02 +01:00
parent a31fd64112
commit 7457a901a9
48 changed files with 8726 additions and 3268 deletions
+14 -1
View File
@@ -95,7 +95,20 @@ func (g *GlobalTestCleanup) CleanupAll() {
g.caches = nil
// Clean up the global cache manager as part of the global cleanup
CleanupGlobalCacheManager()
// Use a timeout to prevent hanging
cleanupDone := make(chan struct{})
go func() {
CleanupGlobalCacheManager()
close(cleanupDone)
}()
select {
case <-cleanupDone:
// Cleanup completed successfully
case <-time.After(5 * time.Second):
// Cleanup timed out, but continue
runtime.GC() // Force GC to help clean up
}
// Give background tasks time to finish cleanup
time.Sleep(100 * time.Millisecond)