Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is there a way I can automatically reset the variable of the $storage.counter at 12am at night ? #255

Open
PManager1 opened this issue Dec 11, 2016 · 1 comment

Comments

@PManager1
Copy link

basically I'm trying to do this thing in my app where the user can make api calls only 3 times in 24 hours. after that it will have to wait until next day.

I know its best to save it in the database, but for now, I just wanna do it easy way and then later save it in the db.

@OscarBarrett
Copy link

The easiest way would be to keep track of the last time an API call was made (persisted to $storage), and reset your counter if it has been more than 24 hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants