CrashTest.pl
changeset 23 e621317229f7
parent 19 300b902b5461
child 24 b69b7aa98a1d
equal deleted inserted replaced
22:768aa027e7cb 23:e621317229f7
    29     return $config->{Storage}->{Type}->new($config->{Storage});
    29     return $config->{Storage}->{Type}->new($config->{Storage});
    30 });
    30 });
    31 
    31 
    32 app->attr(decode_queue => sub {
    32 app->attr(decode_queue => sub {
    33     my $self = shift;
    33     my $self = shift;
    34     eval "require $config->{DecodeQueue}->{Type}";
    34     eval "require $config->{DecodeQueue}->{Type}" or die "Loading module failed $@";
    35     return $config->{DecodeQueue}->{Type}->new($config->{DecodeQueue}, $config->{Dumper}, app->storage);
    35     return $config->{DecodeQueue}->{Type}->new($config->{DecodeQueue}, $config->{Dumper}, app->storage);
    36 });
    36 });
    37 
    37 
    38 helper scm_file_link => sub {
    38 helper scm_file_link => sub {
    39     my ($self, $file, $line) = @_;
    39     my ($self, $file, $line) = @_;
    96     my %paramshash = map { $_ => $self->req->param($_) } $self->req->param;
    96     my %paramshash = map { $_ => $self->req->param($_) } $self->req->param;
    97 
    97 
    98     my ($uuid, $uuidstr);
    98     my ($uuid, $uuidstr);
    99     UUID::generate($uuid);
    99     UUID::generate($uuid);
   100     UUID::unparse($uuid, $uuidstr);
   100     UUID::unparse($uuid, $uuidstr);
   101     my $pjson = $self->app->decode_queue->decode($file, \%paramshash, $uuidstr);
       
   102 
   101 
   103     # reply
   102     $self->render_later();
   104     $self->render_text($pjson->{status});
   103 
       
   104     $self->app->decode_queue->decode($file, \%paramshash, $uuidstr, sub {
       
   105             my $pjson = shift;
       
   106             # reply
       
   107             $self->render(text => $pjson->{status});
       
   108         }
       
   109     );
       
   110 
   105 };
   111 };
   106 
   112 
   107 app->secret('My secret passphrase here');
   113 app->secrets([
       
   114     'My secret passphrase here'
       
   115 ]);
   108 app->start;
   116 app->start;