mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-05-24 15:40:19 +08:00
style: 代码格式优化
This commit is contained in:
@@ -23,7 +23,9 @@ function getTempFilePath(ext: string): string {
|
||||
function cleanupTempFile(filePath: string): void {
|
||||
try {
|
||||
if (fs.existsSync(filePath)) fs.unlinkSync(filePath)
|
||||
} catch { /* ignore */ }
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
}
|
||||
|
||||
function notifySessionListChanged(): void {
|
||||
@@ -33,7 +35,9 @@ function notifySessionListChanged(): void {
|
||||
for (const win of wins) {
|
||||
win.webContents.send('api:importCompleted')
|
||||
}
|
||||
} catch { /* ignore */ }
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
}
|
||||
|
||||
function notifyPullResult(dsId: string, status: 'success' | 'error', detail: string): void {
|
||||
@@ -43,7 +47,9 @@ function notifyPullResult(dsId: string, status: 'success' | 'error', detail: str
|
||||
for (const win of wins) {
|
||||
win.webContents.send('api:pullResult', { dsId, status, detail })
|
||||
}
|
||||
} catch { /* ignore */ }
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -51,9 +57,7 @@ function notifyPullResult(dsId: string, status: 'success' | 'error', detail: str
|
||||
*/
|
||||
async function fetchToTempFile(ds: DataSource): Promise<string> {
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
const url = ds.url.includes('?')
|
||||
? `${ds.url}&since=${ds.lastPullAt}`
|
||||
: `${ds.url}?since=${ds.lastPullAt}`
|
||||
const url = ds.url.includes('?') ? `${ds.url}&since=${ds.lastPullAt}` : `${ds.url}?since=${ds.lastPullAt}`
|
||||
|
||||
const request = net.request(url)
|
||||
|
||||
@@ -140,7 +144,9 @@ async function executePull(ds: DataSource): Promise<void> {
|
||||
if (result.success) {
|
||||
try {
|
||||
await worker.generateIncrementalSessions(ds.targetSessionId)
|
||||
} catch { /* ignore */ }
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
}
|
||||
} else {
|
||||
result = await worker.streamImport(tempFile)
|
||||
|
||||
Reference in New Issue
Block a user