Closed andy5995 closed 6 years ago
Kinda looks like you have this - cleanupGameStats()
Looks like it is never called however?
@craigpotter very likely. We didn't write the original code, as this is a fork of MegaGlest. Though we've updated a lot of code, there's still a lot that hasn't been reviewed yet. Can you tell if that function works, and just needs to be called somehow?
@sexybiggetje Would it be a good idea to just put the function in a separate file, then run it as a cron/scheduled job?
Sure that's fine, just wget / corl it and write the output to /dev/null :)
Hold off... I don't think this function will do it ... but it is close....
This function only purges games that are marked as "finished" and are less than 5 minutes duration.
Looking at https://zetaglest.dreamhosters.com/showPlayers.php, you can filter by day,week,month and all time.
I suggest I create you separate file which you can wget/curl or run via cronjob that wipes data over 3 months ?
Thoughts?
yeah, that sounds good. But purging at 1 month. I can set up the cron job on the host this code runs on.
No worries... Working on it now.
I don't know of any reason why the database should store stats like these forever
https://zetaglest.dreamhosters.com/showPlayers.php
There's a var in config that determines how many games are shown, and that same var could be used to determine how long to keep data on games played and by what users.