Subversive attack

I created a post-commit subversion hook to send an email every time a commit is made. It calls the python script from the post-commit file in / var / svn / repos / hooks.

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

~/svnnotify.py $REV

But the problem is that the svn commit command takes longer to complete, since it is waiting for the python script to complete. Is there any way around this?

thanks

+3
source share
3 answers

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

+4
source

python script , ().

0

Perhaps put the update in a simple queue that will be crossed out when you run the script called from cron and will send a message if something is in the queue.

The queue can be a simple file in / tmp, a sqlite file, or a MySQL table.

If it takes a long time to send an email, there might be something with the code in the notification script. It does not take long to put the email in the local mail queue.

0
source

Source: https://habr.com/ru/post/1723528/


All Articles