Can all this be replaced by using the batch_size option to bulk_create()? I've haven't looked deeply into this - so would be happy to learn why that doesn't solve this problem.