Update database if task succeed.