question

dwojda avatar image
dwojda asked

Safe time between statstics update and leaderboard download

I've noticed that sometimes when I download leaderboard right after statistics update the leaderboard is not up to date with player data yet. Can you suggest some amount of time that I could add between request to make sure that the leaderboard will always have current user data?

Leaderboards and Statistics
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

Correct - when you send a statistic to the service, if you immediately query the leaderboard for that statistic, it likely won't have the latest value updated yet, as recomputing the leaderboard position for a player is triggered by the stat update and not the request (put another way, the request for a leaderboard is not request->recalculate->return, it's request->return, with the recalculation being a separate task triggered by new statistics being submitted - that helps to ensure that the leaderboard can always be returned as fast as possible). So when you update a statistic, it's best to wait a second before querying the leaderboard.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.