@@ -171,15 +171,19 @@ def post(self, request_data=None, **kwargs):
171171 not request_data .get ('deleted' ):
172172 ref = basename (request_data ['ref' ])
173173 commit = request_data ['after' ]
174- task = handle_callback_hook .delay (
175- owner , repo , ref , 'scm-push' , 'github-push' , commit = commit )
174+ # Delay processing of github push event ( eventual consistency)
175+ task = handle_callback_hook .apply_async (
176+ (owner , repo , ref , 'scm-push' , 'github-push' ),
177+ kwargs = {'commit' : commit }, countdown = 10 )
176178 return created_task (task )
177179 elif request .headers .get ('X-GitHub-Event' ) == 'create' and \
178180 request_data .get ('ref_type' ) == 'branch' and \
179181 request_data .get ('ref' ):
180182 ref = basename (request_data ['ref' ])
181- task = handle_callback_hook .delay (
182- owner , repo , ref , 'scm-create' , 'github-create' )
183+ # Delay processing of github create event ( eventual consistency)
184+ task = handle_callback_hook .apply_async (
185+ (owner , repo , ref , 'scm-create' , 'github-create' ),
186+ countdown = 10 )
183187 return created_task (task )
184188 else :
185189 # Ignore all other hooks
0 commit comments