Skip to content

Commit 832df85

Browse files
committed
Fix Multi thread single instance mode variable
1 parent 8f9411f commit 832df85

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

admin/.env.development

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
ENV = 'development'
33

44
# base api
5-
VUE_APP_BASE_API = 'http://127.0.0.1:8000'
5+
VUE_APP_BASE_API = 'http://127.0.0.1:5200'
66

77
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
88
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.

laravel/app/Http/Repository/MultithreadingRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ private function saveTotalExcel($api_id, $total)
669669
/**
670670
* BusRepository constructor.
671671
*/
672-
private function __construct()
672+
public function __construct()
673673
{
674674
//$this->ql || $this->ql = QueryList::getInstance();
675675
}

laravel/app/Listeners/ApiExcelSwooleListener.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ public function handle(Event $event)
3838
$apiExcel = ApiExcel::find($data['id']);
3939
$param = $apiExcel->apiParam()->first();
4040
if ($param) {
41-
$multi = MultithreadingRepository::getInstent();
41+
// $multi = MultithreadingRepository::getInstent();
42+
$multi = new MultithreadingRepository();
4243
$multi->setApiExcelId($data['id']);
4344
$multi->setParam($path, ['concurrent' => $apiExcel->concurrent]);
4445
$is_open = $apiExcel->concurrent > 1;
@@ -59,6 +60,8 @@ public function handle(Event $event)
5960
$fileName = $multi->saveExcel($param, $result);
6061

6162
if (!$fileName) {
63+
$apiExcel->state = 5;
64+
$apiExcel->save();
6265
throw new \Exception(date('Y-m-d H:i:s').' 任务失败: Writer\Exception~!');
6366
}
6467

0 commit comments

Comments
 (0)