I have this code in a module being run by a plugin.

local http = game:GetService("HttpService")

local rateCap, rateWait = 500/2, 60

local rate = game.Workspace.RobloxMod.update.rate

function request(url)
	repeat
		wait()
	until rate.Value < rateCap -- wait until queue has space
	rate.Value = rate.Value + 1
	return http:GetAsync(url)
end

-- apologies for the mess, its not ironed out yet. You don't need to read this as I know it is working, just including in-case someone wants to check
spawn(function()
	local lastDuration = os.clock() - rate.updated.Value
	if lastDuration <= rateWait then
		wait(rateWait - lastDuration)
		rate.updated.Value = os.clock()
		rate.Value = 0
	else
		rate.updated.Value = os.clock()
		rate.Value = 0
	end
	repeat
		wait(rateWait)
		rate.updated.Value = os.clock()
		rate.Value = 0
	until complete
end)

-- other code...

Whenever I want to use HttpService:GetAsync() I use this instead. This doesnt seem to fix it though.

I read that the maximum rate at which you can send requests is 500 every minute. I have it configured to 250 requests every 60, 120 and even 360 seconds. All are apparently not enough. Is this even how I should be doing it?

I've also heard about 100 requests every 10 seconds which also doesn't work.

#TLDR What is the actual time I should be waiting between GET requests if it isn't 500 every minute?

2 comments

0

How are we suppose to solve your problem if you won't provide the entire script?

0

@suspectshot108 you dont need the entire script, this is the only part that matters as this is the only part is the only part with GetAsync().