We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here is a patched version an an example:
import 'dart:async'; import 'dart:io'; import 'package:lib5/lib5.dart'; import 'package:pool/pool.dart'; import 'package:vup/generic/state.dart'; import 'package:vup/model/sync_task.dart'; import 'task.dart'; class PinningQueueTask extends QueueTask { @override final String id; @override final List<String> dependencies; @override final threadPool = 'pin'; final String remote; final List<CID> cids; @override double get progress => _progress / cids.length; int _progress = 0; PinningQueueTask({ required this.id, required this.dependencies, required this.remote, required this.cids, }); bool isCancelled = false; final pool = Pool(8); @override void cancel() { isCancelled = true; } @override Future<void> execute() async { logger.verbose('pinning ${cids.length} CIDs on $remote'); final completer = Completer(); for (final cid in cids) { final pins = pinningService.getPinsForHash( cid.hash, ); if (!pins.contains(remote)) { try { if (remote == '_local') { pool.withResource(() async { if (isCancelled) return; await s5Node.pinCID(cid); _progress++; if (progress == cids.length) completer.complete(); }); } else { final sc = mySky.storageServiceConfigs .firstWhere((e) => e.authority == remote); pool.withResource(() async { if (isCancelled) return; final res = await mySky.httpClient.post( sc.getAccountsAPIUrl( '/s5/pin/${cid.toBase64Url()}', ), headers: sc.headers, ); res.expectStatusCode(200); _progress++; if (progress == cids.length) completer.complete(); }); } } catch (e, st) { logger.catched(e, st); } } else{ _progress++; } } if (progress == cids.length) completer.complete(); await completer.future; } }
added else{ _progress++; } and if (progress == cids.length) completer.complete();
else{ _progress++; }
if (progress == cids.length) completer.complete();
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Here is a patched version an an example:
added
else{ _progress++; }
andif (progress == cids.length) completer.complete();
The text was updated successfully, but these errors were encountered: