From 30f89a3652d2858ebb2f98df2e6ba825fe4c4489 Mon Sep 17 00:00:00 2001 From: Rocky28447 <26193486+Rocky28447@users.noreply.github.com> Date: Sun, 11 Nov 2018 19:31:56 -0500 Subject: [PATCH 1/3] Fixed Aero side of infinite yield bug Will no longer infinite yield if boundToCloseFuncs is 0 and will no longer infinite yield if the number of DataCaches is 0. This fixes the Aero side of the infinite yield bug, Roblox has yet to fix the bug on their end. --- .../Aero/Services/DataService.modulescript.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ServerStorage/Aero/Services/DataService.modulescript.lua b/src/ServerStorage/Aero/Services/DataService.modulescript.lua index 2d0a6bf..7fedbc9 100644 --- a/src/ServerStorage/Aero/Services/DataService.modulescript.lua +++ b/src/ServerStorage/Aero/Services/DataService.modulescript.lua @@ -240,7 +240,7 @@ function DataService:FlushAllConcurrent() end) end globalCache:FlushAll() - coroutine.yield() + if (numCaches > 0) then coroutine.yield() end end @@ -282,7 +282,7 @@ function DataService:Start() end end)() end - coroutine.yield() + if (numBinded > 0) then coroutine.yield() end end -- Flush cache: @@ -330,4 +330,4 @@ function DataService:Init() end -return DataService \ No newline at end of file +return DataService From 5f7da63fbbf716dae9e21ea2be4bd57bdf713a1a Mon Sep 17 00:00:00 2001 From: Rocky28447 <26193486+Rocky28447@users.noreply.github.com> Date: Mon, 12 Nov 2018 16:46:51 -0500 Subject: [PATCH 2/3] Changed logic slightly :+1: --- .../Aero/Services/DataService.modulescript.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ServerStorage/Aero/Services/DataService.modulescript.lua b/src/ServerStorage/Aero/Services/DataService.modulescript.lua index 7fedbc9..c1df0ef 100644 --- a/src/ServerStorage/Aero/Services/DataService.modulescript.lua +++ b/src/ServerStorage/Aero/Services/DataService.modulescript.lua @@ -221,6 +221,7 @@ function DataService:FlushAllConcurrent() for _,cache in pairs(customCaches) do numCaches = (numCaches + 1) end + if (numCaches == 0) then return end local function IncFlushed() numFlushed = (numFlushed + 1) if (numFlushed == numCaches) then @@ -240,7 +241,7 @@ function DataService:FlushAllConcurrent() end) end globalCache:FlushAll() - if (numCaches > 0) then coroutine.yield() end + coroutine.yield() end @@ -270,6 +271,7 @@ function DataService:Start() local function FireBoundToCloseCallbacks() local thread = coroutine.running() local numBinded = #boundToCloseFuncs + if (numCaches == 0) then return end local numCompleted = 0 local maxWait = 20 local start = tick() @@ -282,7 +284,7 @@ function DataService:Start() end end)() end - if (numBinded > 0) then coroutine.yield() end + coroutine.yield() end -- Flush cache: From d518045caa4d289e4bf75180c780edd91d0e93f5 Mon Sep 17 00:00:00 2001 From: Rocky28447 <26193486+Rocky28447@users.noreply.github.com> Date: Mon, 12 Nov 2018 16:47:46 -0500 Subject: [PATCH 3/3] Made an oopsie, fixed now. --- src/ServerStorage/Aero/Services/DataService.modulescript.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ServerStorage/Aero/Services/DataService.modulescript.lua b/src/ServerStorage/Aero/Services/DataService.modulescript.lua index c1df0ef..2ce5145 100644 --- a/src/ServerStorage/Aero/Services/DataService.modulescript.lua +++ b/src/ServerStorage/Aero/Services/DataService.modulescript.lua @@ -271,7 +271,7 @@ function DataService:Start() local function FireBoundToCloseCallbacks() local thread = coroutine.running() local numBinded = #boundToCloseFuncs - if (numCaches == 0) then return end + if (numBinded == 0) then return end local numCompleted = 0 local maxWait = 20 local start = tick()