Tatsuki SUGIURA
sugi****@users*****
2006年 7月 12日 (水) 20:41:56 JST
Index: slashjp/plugins/ResKey/tasks/reskey_purge.pl diff -u /dev/null slashjp/plugins/ResKey/tasks/reskey_purge.pl:1.1 --- /dev/null Wed Jul 12 20:41:56 2006 +++ slashjp/plugins/ResKey/tasks/reskey_purge.pl Wed Jul 12 20:41:55 2006 @@ -0,0 +1,25 @@ +#!/usr/bin/perl -w +# This code is a part of Slash, and is released under the GPL. +# Copyright 1997-2005 by Open Source Technology Group. See README +# and COPYING for more information, or see http://slashcode.com/. +# $Id: reskey_purge.pl,v 1.1 2006/07/12 11:41:55 sugi Exp $ + +use strict; + +use Slash::Constants qw(:slashd :reskey); + +use vars qw( %task $me ); + +$task{$me}{timespec} = '3 * * * *'; +$task{$me}{timespec_panic_1} = ''; # if panic, this can wait +$task{$me}{fork} = SLASHD_NOWAIT; +$task{$me}{code} = sub { + my($virtual_user, $constants, $slashdb, $user, $info, $gSkin) = @_; + + if (my $reskey = getObject('Slash::ResKey')) { + my $count = $reskey->purge_old || 0; + slashdLog("Purged $count reskeys\n"); + } +}; + +1;