Is it dangerous to call a function that deletes nodes based on criteria while a cron job is running that imports them I have custom module that performs a dbquery on a button click that deletes nodes that fit a certain criteria. Is it dangerous that I also occasionally run a cron job that imports nodes that fit this criteria? If I ran both at the same time could something break?
Depends on the way you import:


If you delete the nodes on some criteria and import the nodes as new nodes ($node-&gt;is_new = TRUE), this shouldn't be a problem.
If you are updating the existing nodes while importing and deleting the nodes at the same time, then there could be issues.


This is because the node_save() function internally calls drupal_write_record, which creates a node with an incremental nid value if the $node-&gt;is_new is set to TRUE. Or updates the exiting nodes if you are importing.