开发者

Subversion post-commit hook

I have created a subversion post-commit hook to send out an email everytime a commit is made.Im calling a python script from the file post-commit in /var/svn/repos/hooks .

REPOS="$1"
REV="$2"

~/svnnotify.py $REV

But the problem is that the svn commit command is t开发者_运维知识库aking a longer time to terminate as it waits for the python script to terminate first . Is there any way around this ?

Thank You


Try adding an ampersand (&) after the line that calls your script to put it in the background and return immediately.


Call a batch file and in that batch file execute python script to run in the background by adding ampersand at end of command in batch file( & ).


Maybe put the update in a simple queue that gets scooped up by a script run invoked from cron and sends a message if something is sitting in the queue.

Queue could be a simple file in /tmp, an sqlite file, or a MySQL table.

If it's taking noticeably long to send the e-mail, maybe there's something up with the code in the notify script. It shouldn't take that long to put an e-email in the local mail queue.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜