Yenta/Store/Expire.pm untested

filter: Statementstmt 0.0% 0 / 23 Branchbran 0.0% 0 / 2 Conditioncond n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 32 CC 2 SCAR 11.5
CC
2
Cov
0%
periodic
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.1
1 # -*- perl -*-
2  
3 # Copyright (c) 2009 AdCopy
4 # Author: Jeff Weisberg
5 # Created: 2009-Apr-13 11:55 (EDT)
6 # Function: auto-expire old data
7 #
8 # $Id: Expire.pm,v 1.8 2010/12/23 19:09:39 jaw Exp $
9  
10 package AC::Yenta::Store::Expire;
11 use AC::Yenta::Config;
12 use AC::Yenta::Debug 'expire';
13 use AC::Yenta::Conf;
14 use AC::DC::Sched;
15 use strict;
16  
17 AC::DC::Sched->new(
18 info => 'expire',
19 freq => 60,
20 func => \&AC::Yenta::Store::Expire::periodic,
21 );
22  
23 sub periodic {
24  
25 my $maps = conf_value('map');
26 for my $map (keys %$maps){
27 my $cf = conf_map($map);
28 next unless $cf->{expire};
29  
30 my $expire = timet_to_yenta_version($^T - $cf->{expire});
31 debug("running expire from $expire");
32 AC::Yenta::Store::store_expire( $map, $expire );
33 }
34 }
35  
36 ################################################################
37  
38  
39 1;