Refactor the group history worker to a rake task to save memory leakage for now