I was keen to know the purpose of the hook_cron function in the ip.module

function ip_cron() {
  // Process backlog of nodes.
  ip_backlog_nodes();
  // If nodes are done, process comments.
  if (!variable_get('ip_backlog_nodes', PHP_INT_MAX)) {
    ip_backlog_comments();
  }
}

It appears redundant considering that both hook_node_insert and hook_comment_insert are implemented.

Comments

alansaviolobo created an issue. See original summary.

gedur’s picture

It seems that the module tries to get information from previous posts, maybe the original idea was to extract data loaded before the module instalation (which could not be useful in all cases). This information is taken form the comments table and watchdog for nodes (trick). This is what I think as I was not the original maintainer of the module.

gedur’s picture

I'm thinking in moving this feature into a drush command, this way this will be optional and could be done once. I makes no sense to have it running in a cron process always because after install the module the data will be stored within hooks.

  • GeduR committed 07c97e4 on 8.x-2.x
    Issue #2586099: only save numeric ids (ip_posts)
    
  • GeduR committed 354d1db on 8.x-2.x
    Issue #2586099: ip_posts views integration and views misc
    
gedur’s picture

Status: Active » Fixed

The cron process has been moved to drush commands to be executed on demand.

  • GeduR committed 374cf1c on 7.x-2.x
    Issue #2586099: cron backlog process moved to drush command
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.