[HELP] Voting not working for derelict players

Discussion in 'Empire Help & Support' started by ColPun, Nov 24, 2014.

  1. I was trying to vote for my friend (codemaster98) so that he wouldn't lose his res, because I noticed it had been 30 days. I tried voting for him on 3 different sites but none of them went through and it still says his last vote was 45 days ago. Is this purposeful or a bug?
  2. It takes some time for it to register, I did it for roblikescake and it took like half an hour
  3. How would that be purposeful?
  4. when you /p someone who is offline, the result is cached for a while. You can switch to a diff SMP to then /p again. The votes did register.
    cadgamer101 and 607 like this.
  5. Thanks everyone for the help.
  6. Yeah I noticed this too when I was voting for someone else. I am wondering if the cache could be removed/updated when you vote to avoid this confusion?
  7. Simple answer is no. Although this is an option, the reason there is a cache on this information is to reduce the number database polls executed which is nice.
    607 likes this.
  8. Of course! The database polls would still be reduced and your cache system would remain perfectly intact and functional. There are two possible implementations that you have now. Either:

    A) You cache all the profile data for each user periodically, such as in the middle of the night when no one is online. Typing /p retrieves directly from the cache, and never from the database. The only difference would be one modification to the cache when you receive the votifier notification that a vote went through. You don't even have to touch the database, just set the 'last vote' field to be immediate and leave everything else in the cache the same.

    B) When a /p request is performed, the data is grabbed first from the cache. If the cache is out of date, or doesn't exist, then the data is pulled from the database and cached. In this case, the only difference is a modification to mark the cache out of date or remove the cache when a votifier notification comes through. An additional query is only required in the small percentage of cases where someone requests that profile before the cache would expire anyways, which is exactly when the cache would be out of date.

    In either case we are looking at a very limited cost, and I think having relevant information is more important than this minor inefficiency.
    607 likes this.