# HG changeset patch # User Vincent Tondellier # Date 1455474951 -3600 # Node ID 10a62da240f4a77d4cb6e627fb95bf1182bc3984 # Parent 6f091abdf5fbb8c41b3e4d359a444bd1fcb37d2c Fix missing argument to create diff -r 6f091abdf5fb -r 10a62da240f4 lib/CrashTest/Model/CrashReport.pm --- a/lib/CrashTest/Model/CrashReport.pm Wed Dec 30 19:57:32 2015 +0100 +++ b/lib/CrashTest/Model/CrashReport.pm Sun Feb 14 19:35:51 2016 +0100 @@ -23,9 +23,15 @@ } sub create { - my ($self, $uuid, $pjson, $dump) = @_; + my ($self, $uuid, $pjson, $client_info, $dump) = @_; + + return $self->app->storage->each("CrashReport::create", $uuid, $pjson, $client_info, $dump); +} - return $self->app->storage->each("CrashReport::create", $uuid, $pjson, $dump); +sub update { + my ($self, $uuid, $pjson, $client_info, $dump) = @_; + + return $self->app->storage->each("CrashReport::update", $uuid, $pjson, $client_info, $dump); } sub get_processed_data { diff -r 6f091abdf5fb -r 10a62da240f4 lib/CrashTest/Plugin/Storage/File.pm --- a/lib/CrashTest/Plugin/Storage/File.pm Wed Dec 30 19:57:32 2015 +0100 +++ b/lib/CrashTest/Plugin/Storage/File.pm Sun Feb 14 19:35:51 2016 +0100 @@ -36,7 +36,8 @@ package CrashTest::Plugin::Storage::File::Model::CrashReport; use Mojo::Base -base; use Mojo::Util qw/slurp spurt/; -use Mojo::JSON qw/j decode_json/; +use Mojo::JSON::MaybeXS; +use Mojo::JSON qw/encode_json decode_json/; use File::Spec; has [ qw/instance app config extra_columns data_path/ ]; @@ -50,9 +51,9 @@ } sub create { - my ($self, $uuid, $pjson, $client_info, $dump) = @_; + my ($self, $uuid, $pjson, $client_info, $dmp_file) = @_; - $self->_store_dump($uuid, $dump); + $self->_store_dump($uuid, slurp($dmp_file)); $self->_store_processed_data($uuid, $pjson, $client_info); } @@ -76,7 +77,7 @@ my $jsonfilename = File::Spec->catfile($self->data_path, "$uuid.json"); my $dmpfilename = File::Spec->catfile($self->data_path, "$uuid.dmp"); - spurt(j($pjson), $jsonfilename) or die $!; + spurt(encode_json($pjson), $jsonfilename) or die $!; # Set time of the .dmp to the CrashTime my $crashtime = $pjson->{client_info}->{CrashTime};