开发者

How to Run a subversion post-commit hook as low-priority separate thread

I have a long-running post-commit hook that updates an index of subversion repository (from the project http://svnquery.tigris.org/) The postcommit hook already runs as a separate thread due to the RunDetached executable provided as part of svnquery. The postcommit hook is

C:\SvnIndex\RunDetached C:\SvnIndex\svnindex.exe update D:\IndexData D:\repository -f "(/tags/)|(/branches/)"

This works ok, except that it shoots the CPU usage up to 100% and starves out the other threads on the syste开发者_运维技巧m, making my machine unresponsive. Is there anyway in general to run a process with a lower thread priority from an svn hook?

(This is on a Windows Server 2003 box)


You should be able to RunDetached a batch file that runs svnindex and then uses something like ProcessUtil to lower its priority.


I suggest you file an enhancement request for the svnindex project:

Add a new parameter to specify the thread priority

Once that's implemented, you could then pass the new parameter in your hook script to svnindex.exe and have it run with the specified thread priority.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜