I have an app that allows users to connect to meetup.com. Once connected, their current meetup groups are shown in a dashboard. Currently, I have a button that allows a user to resync their groups ( in case they've joined or resigned from a group since their last visit to my site). With my current setup, theoretically, a user could just click the button over and over and put the app over the API limit. I'm looking for suggestions to deal with this. I know I could keep track of the number of requests within a certain time frame for a user and disable the functionality temporarily, but I wonder if there are some 'thinking outside the box' solutions out there. Site made with Laravel 5.2 and Vue 1.0, redis, MySQL Thanks in advance!
Asked
Active
Viewed 119 times
1
-
Why not just remove the button entirely and run a scheduled task to refresh everyones groups? That way you ensure everyone is always up to date and you don't worry about hitting the rate limit - if you span them out. Otherwise you could just check the `updated_at` field and then only show the button if it was outside a certain time frame? – James Jun 10 '16 at 05:28
-
That crossed my mind, just trying to figure out the timing to ensure everyone is always up to date. – Clay Jun 10 '16 at 05:34
-
You could figure out how much of the rate limit you wanted to have left and then deduct that from the available rate limit and just update that many users at a time using `take` and `offset` – James Jun 10 '16 at 08:33