Skip to content

Commit 5fe203b

Browse files
aliaspooryoriklmajano
authored andcommitted
Cache policies LRU error (#590)
COLDBOX-1280 https://ortussolutions.atlassian.net/browse/COLDBOX-1280 #Resolve * check if md keys exist before referencing Fixes error: Error sorting via store indexer Element TIMEOUT is undefined in MD. coldfusion.runtime.UndefinedElementException: Element TIMEOUT is undefined in MD. * Add default value if missing Fixes error: Error sorting via store indexer Invalid property requested: isSoftReference Valid properties are: coldfusion.runtime.CustomException: Invalid property requested: isSoftReference
1 parent 7a360db commit 5fe203b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

system/cache/policies/AbstractEvictionPolicy.cfc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ component
8383
continue;
8484
}
8585
var md = indexer.getObjectMetadata( item );
86+
if ( NOT md.keyExists( "timeout" ) || NOT md.keyExists( "isExpired" ) ) {
87+
continue;
88+
}
8689

8790
// Evict if not already marked for eviction or an eternal object.
8891
if ( md.timeout GT 0 AND NOT md.isExpired ) {

system/cache/store/ConcurrentSoftReferenceStore.cfc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ component extends="coldbox.system.cache.store.ConcurrentStore" accessors=true {
189189
if (
190190
!isNull( local.softRef ) && variables.indexer.getObjectMetadataProperty(
191191
arguments.objectKey,
192-
"isSoftReference"
192+
"isSoftReference",
193+
false
193194
)
194195
) {
195196
variables.softRefKeyMap.remove( softRef.hashCode() );

0 commit comments

Comments
 (0)