update cron->ajaxExec method

This commit is contained in:
aaronchen2k
2020-01-15 18:54:21 +08:00
parent c04650c507
commit e6ce735079
5 changed files with 10 additions and 7 deletions
+1 -1
View File
@@ -15,4 +15,4 @@ $config->repo->binary = '|pdf|';
$config->repo->requiredFields = 'name,repo,buildType,jenkins,jenkinsTask,triggerType';
$config->repo->commitCommands = array(build=>'Build #12345', entity=>'/(.*)\s(?:(?:requirement)|(?:task)|(?:Bug))\s?#(.*)/Ui');
$config->repo->commitCommands = array(entity=>'/(.*)\s(?:(?:requirement)|(?:task)|(?:Bug))\s?#(.*)/Ui');
+3 -1
View File
@@ -347,6 +347,8 @@ class ci extends control
*/
public function exeCitask($id)
{
error_log("===exeCitask " . $id);
$this->ci->exeCitask($id);
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
@@ -362,7 +364,7 @@ class ci extends control
*/
public function checkCibuild()
{
error_log("checkCibuild...");
error_log("===checkCibuild");
$this->ci->checkCibuild();
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
+3 -3
View File
@@ -238,7 +238,7 @@ class ciModel extends model
}
$cron = (object) array('m'=>$min, 'h'=>$hour, 'dom'=>'*', 'mon'=>'*',
'dow'=> $days . '/' . $task->scheduleInterval, 'command'=>'moduleName=ci&methodName=exeCitask&id=' . $taskId,
'dow'=> $days . '/' . $task->scheduleInterval, 'command'=>'moduleName=ci&methodName=exeCitask&params=' . $taskId,
'remark'=>($this->lang->citask->extTask . $taskId), 'type'=>'zentao',
'buildin'=>'-1', 'status'=>'normal', 'lastTime'=>'0000-00-00 00:00:00');
$this->dao->insert(TABLE_CRON)->data($cron)->exec();
@@ -282,9 +282,9 @@ class ciModel extends model
if ($task->scheduleDay == 'everyDay') {
$days = '1-7';
} else if ($task->scheduleDay == 'workDay') {
$days = '1-5';
$days = '2-6';
}
$command = 'moduleName=ci&methodName=exeCitask&id=' . $id;
$command = 'moduleName=ci&methodName=exeCitask&params=' . $id;
$this->dao->update(TABLE_CRON)
->set('m')->eq($min)
+2 -1
View File
@@ -201,7 +201,8 @@ class cron extends control
if(isset($params['moduleName']) and isset($params['methodName']))
{
$this->app->loadConfig($params['moduleName']);
$output = $this->fetch($params['moduleName'], $params['methodName']);
$paramArr = explode(",", $params['parm']);
$output = $this->fetch($params['moduleName'], $params['methodName'], $paramArr);
}
}
elseif(isset($crons[$id]) and $crons[$id]->type == 'system')
+1 -1
View File
@@ -33,7 +33,7 @@ class cronModel extends model
public function getCrons($params = '')
{
return $this->dao->select('*')->from(TABLE_CRON)
->where('1=1')
->where('id=16')
->beginIF(strpos($params, 'nostop') !== false)->andWhere('status')->ne('stop')->fi()
->fetchAll('id');
}