function taxonomy_edge_is_build_realtime in Taxonomy Edge 7
Same name and namespace in other branches
- 8 taxonomy_edge.module \taxonomy_edge_is_build_realtime()
- 6 taxonomy_edge.module \taxonomy_edge_is_build_realtime()
- 7.2 taxonomy_edge.module \taxonomy_edge_is_build_realtime()
Checks if it's possible to build an edge realtime.
Return value
boolean TRUE if possible, FALSE if not.
3 calls to taxonomy_edge_is_build_realtime()
- taxonomy_edge_taxonomy_term_delete in ./
taxonomy_edge.module - Implements hook_taxonomy_term_delete().
- taxonomy_edge_taxonomy_term_insert in ./
taxonomy_edge.module - Implements hook_taxonomy_term_insert().
- taxonomy_edge_taxonomy_term_update in ./
taxonomy_edge.module - Implements hook_taxonomy_term_update().
File
- ./
taxonomy_edge.module, line 758 - Optimization of taxonomy data model for SQL performance.
Code
function taxonomy_edge_is_build_realtime($vid) {
if (variable_get('taxonomy_edge_build_realtime', TAXONOMY_EDGE_BUILD_REALTIME)) {
$queue = DrupalQueue::get('taxonomy_edge_items_' . $vid, TRUE);
if ($queue
->numberOfItems()) {
// Don't build realtime, if there are still items left in the queue.
return FALSE;
}
if (!lock_may_be_available('taxonomy_edge_rebuild_edges_' . $vid)) {
// Don't build realtime, if entire tree rebuild is in progress.
return FALSE;
}
return TRUE;
}
return FALSE;
}