mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-07 00:50:27 +00:00
fix: tracker cdn retry issue
This commit is contained in:
1 parent
20130ae6d0
commit
7fdba12376
3 files changed
+30
-11
No files matched your search
@@ -120,7 +120,7 @@ class AppController extends GetxController {
|
||||
var allFail = true;
|
||||
for (var cdn in allTrackerSubscribeUrlCdns[u]!) {
|
||||
try {
|
||||
result.addAll(await _fetchTrackers(u));
|
||||
result.addAll(await _fetchTrackers(cdn));
|
||||
allFail = false;
|
||||
break;
|
||||
} catch (e) {
|
||||
@@ -168,10 +168,14 @@ class AppController extends GetxController {
|
||||
Future<List<String>> _fetchTrackers(String subscribeUrl) async {
|
||||
final resp = await proxyRequest(subscribeUrl);
|
||||
if (resp.statusCode != 200) {
|
||||
throw Exception('Failed to get trackers');
|
||||
throw Exception(
|
||||
'Failed to get trackers, status code: ${resp.statusCode}');
|
||||
}
|
||||
if (resp.data == null || resp.data!.isEmpty) {
|
||||
throw Exception('Failed to get trackers, data is null');
|
||||
}
|
||||
const ls = LineSplitter();
|
||||
return ls.convert(resp.data).where((e) => e.isNotEmpty).toList();
|
||||
return ls.convert(resp.data!).where((e) => e.isNotEmpty).toList();
|
||||
}
|
||||
|
||||
_initDownloaderConfig() async {
|
||||
|
||||
Reference in new issue
Block a user