Merge branch 'hotfix/pack_package' of wmtx/platform into release

优化打包
master
廖金灵 5 years ago committed by Gogs
commit bd8842759e

@ -21,6 +21,7 @@ use BaiduBce\Log\LogFactory;
use Think\Think; use Think\Think;
use Base\Service\GameSourceService; use Base\Service\GameSourceService;
use Base\Tool\Printer; use Base\Tool\Printer;
use Base\Tool\Redis;
/** /**
* 后台首页控制器 * 后台首页控制器
@ -49,11 +50,17 @@ class AutoPackController extends Think
exit; exit;
} }
if (Redis::get('console_packing') == 1) {
Printer::export('正在打包', true);
}
Redis::set('console_packing', 1);
$this->checkPackageStatus(); $this->checkPackageStatus();
// $this->app_package();//app渠道自动打包 // $this->app_package();//app渠道自动打包
$this->channel(); $this->channel();
// $this->launch_package(false); // $this->launch_package(false);
// $this->leak_detection(); // $this->leak_detection();
Redis::delete('console_packing');
} }
/** /**
@ -305,6 +312,7 @@ class AutoPackController extends Think
->select(); ->select();
if (count($applys) == 0) { if (count($applys) == 0) {
Redis::delete('console_packing');
Printer::export('无等待队列', true); Printer::export('无等待队列', true);
} }

@ -0,0 +1,38 @@
<?php
namespace Base\Tool;
use Redis as Handler;
class Redis
{
private static $handler;
public static function getHandler()
{
if(self::$handler == null) {
self::$handler = self::createHandler();
}
return self::$handler;
}
private static function createHandler()
{
$host = C('REDIS_HOST', null, '127.0.0.1');
$port = C('REDIS_PORT', null, 6379);
$timeout = C('REDIS_TIMEOUT', null, 300);
$auth = C('REDIS_AUTH');
$handler = new Handler();
$handler->connect($host, $port, $timeout);
if($auth !== null) {
$handler->auth($auth);
}
return $handler;
}
public static function __callStatic($method, $arguments)
{
return call_user_func_array([self::getHandler(), $method], $arguments);
}
}
Loading…
Cancel
Save