[otrs-cvs] otrs/Kernel/System State.pm,1.53,1.54

CVS commits notifications of OTRS.org cvs-log at otrs.org
Sun Jun 19 20:28:16 GMT 2011


Comments:
Update of /home/cvs/otrs/Kernel/System
In directory lancelot:/tmp/cvs-serv7540/Kernel/System

Modified Files:
	State.pm 
Log Message:
Added caching to StateList and StateTypeList.

Author: mb

Index: State.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/State.pm,v
retrieving revision 1.53
retrieving revision 1.54
diff -2 -u -d -r1.53 -r1.54
--- State.pm	17 Jun 2011 10:15:03 -0000	1.53
+++ State.pm	19 Jun 2011 20:28:11 -0000	1.54
@@ -496,4 +496,9 @@
     }
 
+    # check cache
+    my $CacheKey = 'StateList::' . $Valid;
+    my $Cache = $Self->{CacheInternalObject}->Get( Key => $CacheKey );
+    return %{$Cache} if $Cache;
+
     # sql
     my $SQL = 'SELECT id, name FROM ticket_state';
@@ -506,4 +511,8 @@
         $Data{ $Row[0] } = $Row[1];
     }
+
+    # set cache
+    $Self->{CacheInternalObject}->Set( Key => $CacheKey, Value => \%Data );
+
     return %Data;
 }
@@ -613,4 +622,9 @@
     }
 
+    # check cache
+    my $CacheKey = 'StateTypeList';
+    my $Cache = $Self->{CacheInternalObject}->Get( Key => $CacheKey );
+    return %{$Cache} if $Cache;
+
     # sql
     return if !$Self->{DBObject}->Prepare(
@@ -621,4 +635,8 @@
         $Data{ $Row[0] } = $Row[1];
     }
+
+    # set cache
+    $Self->{CacheInternalObject}->Set( Key => $CacheKey, Value => \%Data );
+
     return %Data;
 }


More information about the cvs-log mailing list