Use run_after_commit to avoid race condition, feedback:
Use run_after_commit to avoid race condition, feedback:

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6342/diffs#note_17038749

mmkassem/gitlabhq,stoplightio/gitlabhq,axilleas/gitlabhq,openwide-java/gitlabhq,stoplightio/gitlabhq,mmkassem/gitlabhq,stoplightio/gitlabhq,dplarson/gitlabhq,LUMC/gitlabhq,darkrasid/gitlabhq,htve/GitlabForChinese,jirutka/gitlabhq,axilleas/gitlabhq,daiyu/gitlab-zh,openwide-java/gitlabhq,axilleas/gitlabhq,iiet/iiet-git,stoplightio/gitlabhq,axilleas/gitlabhq,dreampet/gitlab,mmkassem/gitlabhq,htve/GitlabForChinese,mmkassem/gitlabhq,jirutka/gitlabhq,t-zuehlsdorff/gitlabhq,openwide-java/gitlabhq,LUMC/gitlabhq,dplarson/gitlabhq,jirutka/gitlabhq,daiyu/gitlab-zh,openwide-java/gitlabhq,htve/GitlabForChinese,darkrasid/gitlabhq,t-zuehlsdorff/gitlabhq,dplarson/gitlabhq,dplarson/gitlabhq,dreampet/gitlab,daiyu/gitlab-zh,dreampet/gitlab,iiet/iiet-git,iiet/iiet-git,iiet/iiet-git,LUMC/gitlabhq,LUMC/gitlabhq,t-zuehlsdorff/gitlabhq,t-zuehlsdorff/gitlabhq,daiyu/gitlab-zh,jirutka/gitlabhq,htve/GitlabForChinese,darkrasid/gitlabhq,darkrasid/gitlabhq,dreampet/gitlab