作者 赵彬吉

update

... ... @@ -58,7 +58,7 @@ class SyncSubmitTask extends Command
$task_info->project_id = $project->id;
$time2 = time();
SyncSubmitTaskService::handler($task_info);
$this->output('任务用时:' . (time() - $time2));
$this->output('处理用时:' . (time() - $time2));
$task_info->status = 1;
$task_info->save();
... ...
... ... @@ -153,4 +153,16 @@ class DomainInfo extends Base
$value = Arr::s2a($value);
return $value;
}
public static function getCacheInfoByProjectId($project_id){
$cache_key = 'DOMAIN_INFO_BY_PROJECT_ID_' . $project_id;
$data = Cache::get($cache_key);
if(!$data){
$data = DomainInfo::where('project_id', $project_id)->first();
if($data){
Cache::put($cache_key, $data, 3600);
}
}
return $data;
}
}
... ...
... ... @@ -75,7 +75,7 @@ class SyncSubmitTaskService
}
//域名 过滤国家或ip
$domain_info = DomainInfo::where('project_id', $project['id'])->first();
$domain_info = DomainInfo::getCacheInfoByProjectId($project['id']);
if(!empty($domain_info['not_allow_country'])){
$not_allow_countries = CountryCode::whereIn('id', $domain_info['not_allow_country'])->pluck('c_name')->toArray();
if(in_array($data['country'], $not_allow_countries)){
... ...