function media_flush_caches in D7 Media 7
Implements hook_flush_caches().
File
- ./
media.module, line 1123 - Media API
Code
function media_flush_caches() {
// Garbage collection for the {media_filter_usage} table. If an fid was last
// recorded four months ago (minimum three months due to logic in
// media_filter_track_usage()), remove it from this table while the filter
// and field caches are being cleared. If the fid is still in use, it will
// be added back to the table the next time check_markup() runs on that
// content. This prevents fids from staying in this table indefinitely,
// even if the post that references them is edited or deleted.
db_delete('media_filter_usage')
->condition('timestamp', REQUEST_TIME - 86400 * 120, '<')
->execute();
}