ClientConnectionInterruption: allow retrying with current settings

This commit is contained in:
Jesse Chan
2020-11-03 00:04:48 +08:00
parent 4c24f56260
commit 00029514f7
7 changed files with 122 additions and 47 deletions

View File

@@ -22,7 +22,7 @@ export default async (req: Request<unknown, unknown, unknown, {historySnapshot:
const serviceInstances = services.getAllServices(user);
const serverEvent = new ServerEvent(res);
const fetchTorrentList = serviceInstances.torrentService.fetchTorrentList()?.catch((e) => console.error(e));
const fetchTorrentList = serviceInstances.torrentService.fetchTorrentList();
if (serviceInstances.clientGatewayService == null) {
return;
@@ -82,7 +82,7 @@ export default async (req: Request<unknown, unknown, unknown, {historySnapshot:
const {timestamps: lastTimestamps} = snapshot || {timestamps: []};
const lastTimestamp = lastTimestamps[lastTimestamps.length - 1];
if (error == null && snapshot != null) {
if (error == null && snapshot != null && lastTimestamp != null) {
serverEvent.emit(lastTimestamp, 'TRANSFER_HISTORY_FULL_UPDATE', snapshot);
}
});