Small refactoring of ratelimit code to make more sense
This commit is contained in:
@@ -62,7 +62,7 @@ struct RateLimit {
|
||||
//money we have to "buy" tickets
|
||||
long funds;
|
||||
//time of the previos period
|
||||
long last_ts;
|
||||
long last_refill_ts;
|
||||
};
|
||||
|
||||
/** Static initializer for a struct RateLimit
|
||||
@@ -91,7 +91,7 @@ void uc_ratelimit_init(struct RateLimit *r, long tickets, long period);
|
||||
* Reset a RateLimit, filling up the tickets again.
|
||||
*
|
||||
* @param r RateLimit to reset
|
||||
* @param current ts, if non-zero, re-sets the last_ts to the current_ts
|
||||
* @param current ts, if non-zero, re-sets the last_refill_ts to the current_ts
|
||||
*/
|
||||
void uc_ratelimit_reset(struct RateLimit *r, long current_ts);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user