Permalink
Browse files

PRESIDECMS-1469 Take out locks around cache clearing: need to just ca…

…tch concurrency errors for now
  • Loading branch information...
DominicWatson committed Feb 11, 2019
1 parent dcedf13 commit 3e51ba0a4043eab93078e4483dcfe251904c1c65
Showing with 7 additions and 13 deletions.
  1. +7 −13 system/services/presideObjects/PresideObjectService.cfc
@@ -1783,16 +1783,12 @@ component displayName="Preside Object Service" {
keyPrefixes.append( LCase( "#arguments.objectName#.single." ) );
}

// attempting to get the keys of struct while its size may be changing
// can lead to errors - need to lock this operation
lock type="exclusive" timeout=10 name=lockname {
try {
var cacheKeys = cache.getKeys();
} catch( any e ) {
// just in case - need to eliminate these errors fast
// TODO: revisit this entirely
return;
}
try {
var cacheKeys = cache.getKeys();
} catch( any e ) {
// just in case - need to eliminate these errors fast
// TODO: revisit this entirely
return;
}

if ( !ArrayLen( cacheKeys ) ) {
@@ -1818,9 +1814,7 @@ component displayName="Preside Object Service" {
if ( comparison == 0 ) {
try {
deleted.append( i );
lock type="exclusive" timeout=10 name=lockname {
cache.clearQuiet( cacheKeys[ i ] );
}
cache.clearQuiet( cacheKeys[ i ] );
} catch( any e ) {
// do nothing, multiple processes could attempt clearing the same key
}

0 comments on commit 3e51ba0

Please sign in to comment.