Official Thimbleweed Park Forums

Discourse and the "can't give more likes" message


I can’t believe you’re digging into the source code for this :slight_smile:

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. :slight_smile: Beside that:


I’m a computer scientist. I like to know how things and especially software work. :slight_smile:

Same here - but when does the calendar day starts? :slight_smile: 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.


I would guess server time for wherever discourse is hosted.


That leads us to my question in the first post. :wink:



  • the post made me laugh
  • I agree with the post contents
  • the post contains positive thoughts
  • pictures, videos, sounds in the post are worth a mention (and a like)
  • I want to answer “Yes” if the post contains a question towards me


Not sure, but it could be a sliding 24 hour window. So you can only give 50 likes over 24 hours.

Well, we all knew! And even if Discourse didn’t, it does so know.
Isn’t that right?
@discobot fortune


:crystal_ball: Don’t count on it


Don’t try and fool us by playing dumb…
@discobot fortune


:crystal_ball: Yes


How else are you supposed to find such information? The code is the only accurate documentation!

The key is built dynamically: limit_exceeded.rb

It seems to use sliding expiration: rate_limiter.rb


Good point, Ron, er… I mean “Nor” :wink:


Then this window has to start at some point. When is this? The first time I set a like?

But it’s Ruby code. :wink:

Can you point me to the code where the RateLimiter is used to check the Likes?


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”


@someone I think the best and faster way to answer all your questions is to sign up to the Discourse Meta Forums and ask them there or check out the dedicated threads. It’s the official forum for Discourse and you can chat directly with the developers. Me and PiecesOfKate are already signed up and I bet you’ll be welcome there as a long-term Discourse user and a computer scientist.


Ah, Ok, right, now I got it. :slight_smile:


Here the rate limiter checks the range: rate_limiter.rb#L68: if ((tonumber("LLEN", key)) < max) or (now - tonumber("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)


This looks… inefficient. :wink:


Great! Thanks!


It was only for educational purposes :slight_smile: