Closed RafaelVidaurre closed 6 years ago
@monitz87
fulfilled
is never changed after set to true
active
for example) which we make the service try to maintain (we already do something extremely similary for the fulfilled
field).Narzerus has returned to the server after 3 months! He was first invited by Monitz87
@monitz87 about caching. That's a tougher one, why do you have to query each referral for each member every x seconds by the way?
We decided on not querying the database on an interval, but instead only doing it on startup and trusting that no events will be lost by discordjs.
While implementing I ran into some questions:
What do we do when a member with a fulfilled referral leaves the guild? I think we should mark that referral somehow (without it losing its fulfilled status) so that the scoring algorithm can take that into account if needed. The question that arises is what would happen if I invite someone, he spends some time in the guild, leaves, and then after some more time accepts an invite from someone else. If the time periods in between are sufficiently long, it shouldn't be considered cheating. I think the model should reflect that somehow.
Should we cache part of our database in the service? Currently I am fetching a referral for each member for each guild every X seconds (that's a lot of queries to the database on each iteration). If we do, we have to figure out a caching strategy, because it's not feasible to cache our whole referral collection into memory.