Page 1 of 1

Scheduled Tasks

Posted: Sat Feb 04, 2006 6:16 pm
by Zebranky
What do other worlds have as scheduled tasks, and how are they implemented? Specifically, I'd like to clear expired DB records, but things like 90-day player archival, vault backups, etc. would be good to know.

Posted: Sun Feb 05, 2006 12:28 am
by Arkonswrath
Hala currently uses a 6 month player vault purge system. This is the only database info purging we have set up that i know of.

Posted: Sun Feb 05, 2006 3:31 am
by JollyOrc
these are the SQL lines we execute every 5 minutes.

The first line is for expiring variables, the second purges the player_tracking table of really old data.

The third line is for a special variable iHasCastSpell, which is supposed to expire after an hour. The plain vanilla nwnx db expiration only supports expiration by days, but we needed something more fine grained for the Witch Hunter.


No vault purging currently.

Code: Select all

delete FROM pwdata WHERE expire <> 0 AND UNIX_TIMESTAMP(last)+(expire*24*60*60) < UNIX_TIMESTAMP(now());

delete FROM player_tracking WHERE UNIX_TIMESTAMP(DateTimeStamp)+(expire*24*60*60) < UNIX_TIMESTAMP(now())+(60*24*60*60);

select * FROM pwdata WHERE UNIX_TIMESTAMP(last)+(1*60*60) > UNIX_TIMESTAMP(now()) and name="iHasCastSpell";