Scheduled Tasks

Development for CoPaP
Post Reply
Zebranky
Ambassador: The Grey Wastes
Posts: 187
Joined: Sun Apr 24, 2005 4:31 pm

Scheduled Tasks

Post 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.
Arkonswrath
Ambassador: Hala
Posts: 447
Joined: Wed May 26, 2004 3:57 am

Post 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.
JollyOrc
Ambassador: Tairis'nàdur
Posts: 380
Joined: Tue Nov 25, 2003 1:13 am
Location: Catar, D'Aton Academy of the Blade
Contact:

Post 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";
bye,
JollyOrc
___________________
Tairis'nàdur - Senior DM, Catara World Owner
-= fewer rules - more fun =-
Post Reply