I can’t believe you’re digging into the source code for this
My theory would be the first like/post/login of the calendar day starts your count, then you have 24 hours (which is why I noticed a badge at 6am the next day, about 24 since I started checking the forum on Saturday morning)
No, not that much. But sometimes you guys are writing one great post after another - and I would like to honor that with a “like”. If I like a post I would like to show that with a like. And I don’t exceed my like quota every day. Beside that:
I’m a computer scientist. I like to know how things and especially software work.
Same here - but when does the calendar day starts? If the calendar day starts at midnight German time, then why Discourse shows me the warning message? I haven’t liked that much posts and how does Discourse know that I’m living in Germany? I haven’t told him that.
Just whenever you like now it can check how much likes are less than 24h ago.
something like:
If press_like then update_nr_of_likes_since(now-24hours)
if nr_likes_in_last24h > 50 then print “you spend way too much time liking stuff here”
Here the rate limiter checks the range: rate_limiter.rb#L68:
if ((tonumber(redis.call("LLEN", key)) < max) or (now - tonumber(redis.call("LRANGE", key, -1, -1)[1])) > secs) then
Here are the rate limiters created: post_action.rb#L392 (note: there is a special case for likes involving a multiplier)