From 0bbec733e14c58cc7404c8b93f357e57f0eb3b74 Mon Sep 17 00:00:00 2001
From: erickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Date: Wed, 7 Dec 2005 18:32:24 +0000
Subject: [PATCH] added a NO_SESSION event for when a login session does not
 exist Event.pm now takes arbitrary parameters

added a osrfCacheSetExpire method for manually setting the cache expire
time of an object after the object has already been cached


git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@604 9efc2488-bf62-4759-914b-345cdb29e865
---
 src/libstack/osrf_cache.c | 11 +++++++++++
 src/libstack/osrf_cache.h |  5 +++++
 2 files changed, 16 insertions(+)

diff --git a/src/libstack/osrf_cache.c b/src/libstack/osrf_cache.c
index 9c06508..a63c431 100644
--- a/src/libstack/osrf_cache.c
+++ b/src/libstack/osrf_cache.c
@@ -84,3 +84,14 @@ int osrfCacheRemove( char* key, ... ) {
 }
 
 
+int osrfCacheSetExpire( time_t seconds, char* key, ... ) {
+	if( key ) {
+		VA_LIST_TO_STRING(key);
+		jsonObject* o = osrfCacheGetObject( VA_BUF );
+		osrfCacheRemove(VA_BUF);
+		return osrfCachePutObject( VA_BUF, o, seconds );
+	}
+	return -1;
+}
+
+
diff --git a/src/libstack/osrf_cache.h b/src/libstack/osrf_cache.h
index 2159bdd..317cdd0 100644
--- a/src/libstack/osrf_cache.h
+++ b/src/libstack/osrf_cache.h
@@ -74,5 +74,10 @@ char* osrfCacheGetString( char* key, ... );
   */
 int osrfCacheRemove( char* key, ... );
 
+/**
+ * Sets the expire time to 'seconds' for the given key
+ */
+int osrfCacheSetExpire( time_t seconds, char* key, ... );
+
 
 
-- 
2.11.0