Re: Fwd: Fwd: git-daemon access-hook race condition
- From
- Eugene Sajine <euguess@gmail.com>
- Date
- Sep 13, 2013, 17:17 UTC
- Message-ID
- <CAPZPVFY_AD+dg2C3TSDQW3fKXW9qiSMX70MuMtMsMxmnKBoVWA@mail.gmail.com>
- In-Reply-To
- <CAPZPVFZHyzPZnyg5gjhL0tP6Kgd=XFLc6o8ZKsmPXLUSdcc5mA@mail.gmail.com>
Show 22 quoted lines
> > For now I'm trying to do the following: > > access-hook.bash has: > > delayed-notify.bash $@ & > > delayed-notify.bash has: > > sleep 10 > ... > curl ... > > I'm expecting access-hook to spawn new process and return without > waiting for it to finish to let the service to do its job. But when i > do push - it sleeps for 10 seconds anyway. Am i missing something > obvious here? > > Any help is much appreciated! > > Thanks, > Eugene
I found a following solution to make it happen while waiting for somebody to be generous enough to take on the --post-service-hook (unfortunately i'm not a C guy):
It is using 'at' command. The access-hook script has:
echo "delayed-notify.bash $@" | at now
while delayed-notify.bash has:
sleep 10 curl ...
This is not perfect and in certain situations can still fail because the delay is not long enough but this will at least resolve 90% of issues.
I hope that might be helpful for someone.
Thanks, Eugene