Commit e17cf90f authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

DatabaseHelper: Expose cache eviction code as a separate method

parent 63a45cc8
......@@ -84,15 +84,18 @@ class DatabaseHelpers
+ TABLEPOLICY::PrimaryKeyColumn + " = ?";
auto res = sqlite::Tools::executeDelete( dbConnection, req, pkValue );
if ( res == true )
{
Lock l{ Mutex };
auto it = Store.find( pkValue );
if ( it != end( Store ) )
Store.erase( it );
}
removeFromCache( pkValue );
return res;
}
static void removeFromCache( unsigned int pkValue )
{
Lock l{ Mutex };
auto it = Store.find( pkValue );
if ( it != end( Store ) )
Store.erase( it );
}
static void clear()
{
Lock l{ Mutex };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment