--- a/CrashTest.pl Sat Apr 06 22:50:55 2013 +0200
+++ b/CrashTest.pl Sun Apr 07 00:02:00 2013 +0200
@@ -25,14 +25,14 @@
app->attr(storage => sub {
my $self = shift;
- eval "require $config->{Storage}";
- return $config->{Storage}->new($config->{DataDir});
+ eval "require $config->{Storage}->{Type}";
+ return $config->{Storage}->{Type}->new($config->{Storage});
});
app->attr(decode_queue => sub {
my $self = shift;
- eval "require $config->{DecodeQueue}";
- return $config->{DecodeQueue}->new($config);
+ eval "require $config->{DecodeQueue}->{Type}";
+ return $config->{DecodeQueue}->{Type}->new($config->{DecodeQueue}, $config->{Dumper}, app->storage);
});
helper scm_file_link => sub {
@@ -76,7 +76,6 @@
return b($self->t(span => (title => $signature, class => "shortened-signature") => $short_signature));
};
-# Upload form in DATA section
get '/' => sub {
my $self = shift;
$self->stash(files => $self->app->storage->index());
@@ -96,14 +95,10 @@
my $file = $self->req->upload('upload_file_minidump');
my %paramshash = map { $_ => $self->req->param($_) } $self->req->param;
- my $pjson = $self->app->decode_queue->decode($file, \%paramshash);
-
my ($uuid, $uuidstr);
UUID::generate($uuid);
UUID::unparse($uuid, $uuidstr);
-
- $self->app->storage->store_dump($uuidstr, $file);
- $self->app->storage->store_processed_data($uuidstr, $pjson);
+ my $pjson = $self->app->decode_queue->decode($file, \%paramshash, $uuidstr);
# reply
$self->render_text($pjson->{status});