mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-21 04:09:55 +09:00
issuetracker의 changeset sync시 최소 10분 단위로 동작하도록 lock파일을 생성하는 코드 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6575 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
7d9c36859f
commit
794c748f83
1 changed files with 7 additions and 0 deletions
|
|
@ -439,6 +439,11 @@
|
|||
function syncChangeset($module_info)
|
||||
{
|
||||
if(!$module_info->svn_url || !$module_info->svn_cmd) return;
|
||||
|
||||
$lock_file = sprintf('%sfiles/cache/svn/%d.lock', _XE_PATH_,$module_info->module_srl);
|
||||
if(file_exists($lock_file) && filemtime($lock_file)>time()-60*10) return;
|
||||
FileHandler::writeFile($lock_file,' ');
|
||||
|
||||
require_once($this->module_path.'classes/svn.class.php');
|
||||
$oSvn = new Svn($module_info->svn_url, $module_info->svn_cmd, $module_info->svn_userid, $module_info->svn_passwd);
|
||||
$oModel = &getModel('issuetracker');
|
||||
|
|
@ -452,6 +457,7 @@
|
|||
$gap = $status->revision-$latestRevision;
|
||||
if($gap > 500) $gap = 500;
|
||||
$logs = $oSvn->getLog("/", $latestRevision+1, $status->revision, false, $gap, false);
|
||||
if(!$logs || !count($logs)) return;
|
||||
if(count($lost)) {
|
||||
foreach($logs as $log)
|
||||
{
|
||||
|
|
@ -466,6 +472,7 @@
|
|||
}
|
||||
$latestRevision = $oModel->getLatestRevision($module_info->module_srl);
|
||||
}
|
||||
FileHandler::removeFile($lock_file);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue