X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FReplicated%2FPool.pm;h=123cc47521d05d62264b9ac8a5481bb69760c662;hp=4f406c3333835b117efc06eea75424bdf69e174f;hb=17b05c131035f73964c434c1a9c8b28e46aebeeb;hpb=a5ebb8769b79f6d6ce7a01001d7b41b62386f425 diff --git a/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm b/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm index 4f406c3..123cc47 100644 --- a/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm +++ b/lib/DBIx/Class/Storage/DBI/Replicated/Pool.pm @@ -43,6 +43,25 @@ has 'maximum_lag' => ( default=>0, ); +=head2 last_validated + +This is an integer representing a time since the last time the replicants were +validated. It's nothing fancy, just an integer provided via the perl time +builtin. + +=cut + +has 'last_validated' => ( + is=>'rw', + isa=>'Int', + reader=>'last_validated', + writer=>'_last_validated', + lazy=>1, + default=>sub { + time; + }, +); + =head2 replicant_type ($classname) Base class used to instantiate replicants that are in the pool. Unless you @@ -229,6 +248,9 @@ sub validate_replicants { $replicant->active(0); } } + + ## Mark that we completed this validation. + $self->_last_validated(time); } =head1 AUTHOR