Refactor to run all tasks for one user at a time not all of them
It is too slow to add or edit one user because at the moment all the tasks are done for all the users one at a time.
Everything needs to be rearranged so that just one user can up added / updated at a time in addition to updating the whole system or updating all users.