#!perl
use strict;
use 5.008;
# PODNAME: dbix_locker_pureg
# ABSTRACT: purge old locks
my ($opt, $usage) = describe_options(
'%c %o',
[ 'locker-class=s', 'locker class to purge (default: $DBIX_LOCKER_CLASS)',
{ default => $ENV{DBIX_LOCKER_CLASS}, required => 1} ],
);
eval "require $opt->{locker_class};" or die $@;
my $logger = Log::Dispatchouli->new({
program_name => 'dbix_locker_purge',
facility => 'daemon',
to_stdout => 1,
});
my $locks = $opt->{locker_class}->new->purge_expired_locks;
$logger->([ 'purged %s locks', $locks ]);
__END__
=pod
=head1 NAME
dbix_locker_pureg - purge old locks
=head1 VERSION
version 0.100112
=head1 AUTHOR
Ricardo SIGNES <rjbs@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut