You are here

protected function MigrateDestinationComment::disableStatistics in Migrate 7.2

Updating node statistics on every comment imported or rolled back is expensive. We disable node statistics while performing imports and rollbacks, then re-enable and compute them in bulk when done.

2 calls to MigrateDestinationComment::disableStatistics()
MigrateDestinationComment::preImport in plugins/destinations/comment.inc
Implements MigrateDestination::preImport().
MigrateDestinationComment::preRollback in plugins/destinations/comment.inc
Implements MigrateDestination::preRollback().

File

plugins/destinations/comment.inc, line 287
Support for comment destinations.

Class

MigrateDestinationComment
Destination class implementing migration into comments.

Code

protected function disableStatistics() {

  // If maintaining node statistics is enabled, temporarily disable it
  $this->maintainNodeStatistics = variable_get('comment_maintain_node_statistics', TRUE);
  if ($this->maintainNodeStatistics) {
    $GLOBALS['conf']['comment_maintain_node_statistics'] = FALSE;
  }
}