优化打包

master
ELF 4 years ago
parent 4f8f18a680
commit 1c3bb3604e

@ -49,20 +49,21 @@ class AutoPackController extends Think
$progressLimit = C('PACK_PROGRESS_LIMIT', null, 1); $progressLimit = C('PACK_PROGRESS_LIMIT', null, 1);
$currentProgress = Redis::incr('console_packing'); $currentProgress = Redis::incr('console_packing');
$progressId = date('His') . rand(100, 999) . $currentProgress;
if ($currentProgress > $progressLimit) { if ($currentProgress > $progressLimit) {
Redis::decr('console_packing'); Redis::decr('console_packing');
Printer::export('打包进程已满,进程数量限制[' . $progressLimit . ']', true); Printer::export('打包进程已满,进程数量限制[' . $progressLimit . ']', true);
} }
Printer::export('打包进程[' . $currentProgress . ']开始'); Printer::export('打包进程[' . $progressId . ']开始');
$this->checkPackageStatus(); $this->checkPackageStatus();
// $this->app_package();//app渠道自动打包 // $this->app_package();//app渠道自动打包
$result = $this->channel($currentProgress); $result = $this->channel($progressId);
// $this->launch_package(false); // $this->launch_package(false);
// $this->leak_detection(); // $this->leak_detection();
Redis::decr('console_packing'); Redis::decr('console_packing');
$message = '打包进程[' . $currentProgress . ']结束。' $message = '打包进程[' . $progressId . ']结束。'
. '处理数量[' . $result['total'] . ']' . '处理数量[' . $result['total'] . ']'
. '成功数量[' . $result['success'] . ']' . '成功数量[' . $result['success'] . ']'
. '失败数量[' . $result['error'] . ']'; . '失败数量[' . $result['error'] . ']';
@ -306,7 +307,7 @@ class AutoPackController extends Think
/** /**
* 渠道游戏打包 * 渠道游戏打包
*/ */
private function channel($currentProgress = 0) { private function channel($progressId = 0) {
$map = []; $map = [];
$map['status'] = 1; $map['status'] = 1;
$map['enable_status'] = ['in', '0,2']; $map['enable_status'] = ['in', '0,2'];
@ -347,7 +348,7 @@ class AutoPackController extends Think
$game = $games[$apply['game_id']]; $game = $games[$apply['game_id']];
$launchCount = $launchCountList[$apply['id']] ?? 0; $launchCount = $launchCountList[$apply['id']] ?? 0;
$result = $gameSourceService->channelPack($gameSource, $game, $apply, $launchCount); $result = $gameSourceService->channelPack($gameSource, $game, $apply, $launchCount);
$message = '进程[' . $currentProgress . '],游戏['. $apply['game_id'] . '],渠道['. $apply['promote_id'] . ']打包,'; $message = '进程[' . $progressId . '],游戏['. $apply['game_id'] . '],渠道['. $apply['promote_id'] . ']打包,';
$packResult['total'] += 1; $packResult['total'] += 1;
if ($result['status']) { if ($result['status']) {
$message = 'SUCCESS ----- ' . $message . $result['message']; $message = 'SUCCESS ----- ' . $message . $result['message'];

Loading…
Cancel
Save