Sign In Register

How can we help you today?

Start a new topic

Daily Script hitting API limits in Live

I have a daily script that rewards players with points on a global leaderboard based on their position on the daily (and depending on the day, weekly and monthly) leaderboard results across multiple game modes and levels (a total of 16 leaderboards).


It would only take 10 or so players in each of these leaderboards to hit the API request limit of 100/s for adding their points to the global ranking leaderboard every time this script runs to completely ruin the ranking calculation.


I've been running this game live for months before the new pricing came into effect with these scripts in place but now players are starting to lose out on their points. The game hasn't even launched fully yet and is still in early access with only 150-180 MAUs.


I feel like requests triggered from cloud code (ie that were sent between your own servers) shouldn't be triggering the api limit as it makes any scheduled tasks like this completely impossible.


So I tried to work around this problem by using the scheduler to run this task asynchronously but I get the issue of only being allowed to chain 10 scripts this way.


I have a script that processes a user on a leaderboard (or the top user if none is provided) and then schedules itself 1 second later to process the next user. I was going to expand this out to processing 3 users in one call (which would work out to 48 requests per second for 16 leaderboards, well below the api limit) but I ran into the error:


"You can only chain the scheduling of 10 scripts. The script with the shortCode rankings_daily was not scheduled"


I'm going to assume that this means any script that has to perform bulk actions on leaderboards are now completely impossible to use on this platform.

It's better to do those rewards calculation when the user connect to the game.  Imagine you have 1M users in your leaderboard, the script could never work if ran directly by the system.

Login to post a comment