Help - Datastore2 | Not running script because past shutdown deadline

Hello, I would like help to know what is the cause of the error and how to fix it.

I use datastore2 to save and store user data, among them I use to save a true or false variable to see if I already claim the group premium.

The point is that at the moment of applying the data:

local Roullete = Database("GroupRewards", plr)
local success, errorMessage = pcall(function()
	Roullete:Set(true)
end)

if not success then
	warn("[ERROR] Data roullete of "..plr.Name..", Not saving")
end

I get this error (something that did not happen before):
“Not running script because past shutdown deadline”

If I save it within the game without needing to do so when the player or player event exits. When I stop the game, it creashea for 10 seconds and then jump that error in different scripts that keep a “wait()” in their code. But if I don’t save it, the game saves normally, it doesn’t matter if I save it before or after, it always happens when I close the game.

Within the same game, it happens to close, but it does not save.
Any solution?

IG you can force the shutdown to be delayed a little?

game:BindToClose(function()
    task.wait(3) -- to give it like 3 extra seconds to process it
end)

I found the solution, apparently the cache was overexploding because of so many things I have saved in the playerremove, so what I did is to do the Set() during the game to avoid the cache overexploitation.

thank you for your help anyways

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.