Skip to content

Commit

Permalink
Merge pull request #370 from gnunicorn/ben-fix-368
Browse files Browse the repository at this point in the history
Allow reading of Reports of up to 1GB in size
  • Loading branch information
fzyzcjy authored Feb 23, 2024
2 parents eba9652 + da7b12d commit 5870a57
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:convenient_test_manager_dart/stores/suite_info_store.dart';
import 'package:convenient_test_manager_dart/stores/video_recorder_store.dart';
import 'package:convenient_test_manager_dart/stores/worker_super_run_store.dart';
import 'package:get_it/get_it.dart';
import 'package:protobuf/protobuf.dart';

class MiscDartService {
static const _kTag = 'MiscDartService';
Expand Down Expand Up @@ -49,8 +50,10 @@ class MiscDartService {

clearAll();
final file = sync ? File(path).readAsBytesSync() : await File(path).readAsBytes();
final reader = CodedBufferReader(file, sizeLimit: 1073741824); // allow for up to 1 Gigabyte

final reportCollection = ReportCollection.fromBuffer(file);
final reportCollection = ReportCollection.create();
reportCollection.mergeFromCodedBufferReader(reader);

Log.d(_kTag, 'readReportFromFile read reportCollection');
await GetIt.I.get<ReportHandlerService>().handle(reportCollection, offlineFile: true, doClear: doClear);
Expand Down

0 comments on commit 5870a57

Please sign in to comment.