Fix for Ignore Slave Server Patch

  1. /**
  2.  * Implementation of hook_comment_insert().
  3.  */
  4. function comment_comment_insert($comment) {
  5.   drupal_set_ignore_slave();
  6. }
  7.  
  8. /*
  9.  * Implementation of hook_comment_update().
  10.  */
  11. function comment_comment_update($comment) {
  12.   drupal_set_ignore_slave();
  13. }
  14.  
  15. /*
  16.  * Helper function to get duration lag from variable
  17.  * if one isn't passed, and then set the session variable
  18.  * that contains the lag.
  19.  *
  20.  * @param $duration
  21.  *   The amount of time to ignore the slave to give it
  22.  *   time to refresh after an insert or update.
  23.  */
  24. function drupal_set_ignore_slave($duration = NULL) {
  25.   if (!$duration) {
  26.     $duration = variable_get('maximum_replication_lag', 10);
  27.   }
  28.   drupal_set_session('ignore_slave_server', REQUEST_TIME + $duration);
  29. }

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.