Skip to content

Commit fb50bf9

Browse files
committed
fix: #23 api invoke function
1 parent 4cca678 commit fb50bf9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/Commands/WikiImportCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,15 @@ private function uploadConfluencePages(string $dataPath, array $tree, array $tit
197197
$wikiId = null;
198198
$waiting_times = 0;
199199
while (true) {
200+
// HACK 如果上传成功立即查询,会报错:invoke function
201+
sleep(1);
200202
$jobStatus = $this->coding->getImportJobStatus(
201203
$this->codingToken,
202204
$this->codingProjectUri,
203205
$result['JobId']
204206
);
205207
if (in_array($jobStatus['Status'], ['wait_process', 'processing']) && $waiting_times < 10) {
206208
$waiting_times++;
207-
sleep(1);
208209
continue;
209210
}
210211
if ($jobStatus['Status'] == 'success') {
@@ -218,7 +219,8 @@ private function uploadConfluencePages(string $dataPath, array $tree, array $tit
218219
}
219220
if (!empty($subPages)) {
220221
$this->info('发现 ' . count($subPages) . ' 个子页面');
221-
$this->uploadConfluencePages($dataPath, $subPages, $titles, $parentId);
222+
// TODO tests
223+
$this->uploadConfluencePages($dataPath, $subPages, $titles, $wikiId);
222224
}
223225
}
224226
}

0 commit comments

Comments
 (0)