From 075c09386508f21c705f5656720c9f8969114c43 Mon Sep 17 00:00:00 2001 From: miker Date: Thu, 3 Mar 2005 18:50:04 +0000 Subject: [PATCH] get_expire method git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@166 9efc2488-bf62-4759-914b-345cdb29e865 --- src/perlmods/OpenSRF/Application/Persist.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/perlmods/OpenSRF/Application/Persist.pm b/src/perlmods/OpenSRF/Application/Persist.pm index e829829..379aa1a 100644 --- a/src/perlmods/OpenSRF/Application/Persist.pm +++ b/src/perlmods/OpenSRF/Application/Persist.pm @@ -160,6 +160,24 @@ __PACKAGE__->register_method( argc => 2, ); +sub get_expire_interval { + my $self = shift; + my $client = shift; + my $slot = shift; + + my $sid = _get_name_id($slot); + my ($int) = $dbh->selectrow_array('SELECT expire_interval FROM store_expire WHERE id = ?;',{},$sid); + return undef unless ($int); + + my ($future) = $dbh->selectrow_array('SELECT atime + expire_interval FROM store_expire WHERE id = ?;',{},$sid); + return $future - time(); +} +__PACKAGE__->register_method( + api_name => 'opensrf.persist.slot.get_expire', + method => 'get_expire_interval', + argc => 2, +); + sub _sweep_expired_slots { return if (shift()); -- 2.11.0