CrashTest.pl
author Vincent Tondellier <tonton+hg@team1664.org>
Thu, 07 Aug 2014 23:50:08 +0200
changeset 34 e0d6597078a5
parent 32 3e776f1b21d4
child 37 013953be0f3b
permissions -rwxr-xr-x
Cleanup: Mojo-ize old code, simplifying perl OO code Make Sql Storage inherit Filesystem, since the DB is only used as an index and still stores on disk
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
     1
#!/usr/bin/env perl
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
     2
12
c98d3fa4a948 Add licence
Vincent Tondellier <tonton+hg@team1664.org>
parents: 11
diff changeset
     3
# This program is free software: you can redistribute it and/or modify
c98d3fa4a948 Add licence
Vincent Tondellier <tonton+hg@team1664.org>
parents: 11
diff changeset
     4
# it under the terms of the GNU General Public License as published by
c98d3fa4a948 Add licence
Vincent Tondellier <tonton+hg@team1664.org>
parents: 11
diff changeset
     5
# the Free Software Foundation, either version 3 of the License, or
c98d3fa4a948 Add licence
Vincent Tondellier <tonton+hg@team1664.org>
parents: 11
diff changeset
     6
# (at your option) any later version.
c98d3fa4a948 Add licence
Vincent Tondellier <tonton+hg@team1664.org>
parents: 11
diff changeset
     7
#
c98d3fa4a948 Add licence
Vincent Tondellier <tonton+hg@team1664.org>
parents: 11
diff changeset
     8
# This program is distributed in the hope that it will be useful,
c98d3fa4a948 Add licence
Vincent Tondellier <tonton+hg@team1664.org>
parents: 11
diff changeset
     9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
c98d3fa4a948 Add licence
Vincent Tondellier <tonton+hg@team1664.org>
parents: 11
diff changeset
    10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
c98d3fa4a948 Add licence
Vincent Tondellier <tonton+hg@team1664.org>
parents: 11
diff changeset
    11
# GNU General Public License for more details.
c98d3fa4a948 Add licence
Vincent Tondellier <tonton+hg@team1664.org>
parents: 11
diff changeset
    12
#
c98d3fa4a948 Add licence
Vincent Tondellier <tonton+hg@team1664.org>
parents: 11
diff changeset
    13
# You should have received a copy of the GNU General Public License
c98d3fa4a948 Add licence
Vincent Tondellier <tonton+hg@team1664.org>
parents: 11
diff changeset
    14
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
c98d3fa4a948 Add licence
Vincent Tondellier <tonton+hg@team1664.org>
parents: 11
diff changeset
    15
0
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
    16
use Mojolicious::Lite;
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
    17
use UUID;
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
    18
use Mojo::JSON;
16
76a5a48538e4 Use helper instead of using the full class name
Vincent Tondellier <tonton+hg@team1664.org>
parents: 12
diff changeset
    19
use Mojo::ByteStream 'b';
3
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    20
use Mojo::UserAgent;
11
0bef3b8087c1 Move filesystem access to lib/
Vincent Tondellier <tonton+hg@team1664.org>
parents: 6
diff changeset
    21
use lib 'lib';
0
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
    22
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
    23
my @valid_params = qw/Add-ons Distributor ProductName ReleaseChannel StartupTime UserID Version BuildID CrashTime Comments/;
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
    24
my $config = plugin 'Config';
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
    25
29
006e82a1bcd0 Add pagination
Vincent Tondellier <tonton+hg@team1664.org>
parents: 24
diff changeset
    26
plugin 'TagHelpers::BootstrapPagination';
006e82a1bcd0 Add pagination
Vincent Tondellier <tonton+hg@team1664.org>
parents: 24
diff changeset
    27
17
c91535b1db3e Move the decoding to a module, and had config to choose which module
Vincent Tondellier <tonton+hg@team1664.org>
parents: 16
diff changeset
    28
app->attr(storage => sub {
c91535b1db3e Move the decoding to a module, and had config to choose which module
Vincent Tondellier <tonton+hg@team1664.org>
parents: 16
diff changeset
    29
    my $self = shift;
34
e0d6597078a5 Cleanup: Mojo-ize old code, simplifying perl OO code
Vincent Tondellier <tonton+hg@team1664.org>
parents: 32
diff changeset
    30
    my $loader = Mojo::Loader->new;
e0d6597078a5 Cleanup: Mojo-ize old code, simplifying perl OO code
Vincent Tondellier <tonton+hg@team1664.org>
parents: 32
diff changeset
    31
e0d6597078a5 Cleanup: Mojo-ize old code, simplifying perl OO code
Vincent Tondellier <tonton+hg@team1664.org>
parents: 32
diff changeset
    32
    my $storage_class = $self->app->config->{Storage}->{Type};
e0d6597078a5 Cleanup: Mojo-ize old code, simplifying perl OO code
Vincent Tondellier <tonton+hg@team1664.org>
parents: 32
diff changeset
    33
    if (my $e = $loader->load($storage_class)) {
e0d6597078a5 Cleanup: Mojo-ize old code, simplifying perl OO code
Vincent Tondellier <tonton+hg@team1664.org>
parents: 32
diff changeset
    34
        die ref $e ? "Exception: $e" : 'Not found!';
e0d6597078a5 Cleanup: Mojo-ize old code, simplifying perl OO code
Vincent Tondellier <tonton+hg@team1664.org>
parents: 32
diff changeset
    35
    }
e0d6597078a5 Cleanup: Mojo-ize old code, simplifying perl OO code
Vincent Tondellier <tonton+hg@team1664.org>
parents: 32
diff changeset
    36
e0d6597078a5 Cleanup: Mojo-ize old code, simplifying perl OO code
Vincent Tondellier <tonton+hg@team1664.org>
parents: 32
diff changeset
    37
    return $storage_class->new(config => $self->app->config->{Storage});
17
c91535b1db3e Move the decoding to a module, and had config to choose which module
Vincent Tondellier <tonton+hg@team1664.org>
parents: 16
diff changeset
    38
});
c91535b1db3e Move the decoding to a module, and had config to choose which module
Vincent Tondellier <tonton+hg@team1664.org>
parents: 16
diff changeset
    39
c91535b1db3e Move the decoding to a module, and had config to choose which module
Vincent Tondellier <tonton+hg@team1664.org>
parents: 16
diff changeset
    40
app->attr(decode_queue => sub {
c91535b1db3e Move the decoding to a module, and had config to choose which module
Vincent Tondellier <tonton+hg@team1664.org>
parents: 16
diff changeset
    41
    my $self = shift;
34
e0d6597078a5 Cleanup: Mojo-ize old code, simplifying perl OO code
Vincent Tondellier <tonton+hg@team1664.org>
parents: 32
diff changeset
    42
    my $loader = Mojo::Loader->new;
e0d6597078a5 Cleanup: Mojo-ize old code, simplifying perl OO code
Vincent Tondellier <tonton+hg@team1664.org>
parents: 32
diff changeset
    43
e0d6597078a5 Cleanup: Mojo-ize old code, simplifying perl OO code
Vincent Tondellier <tonton+hg@team1664.org>
parents: 32
diff changeset
    44
    my $decode_class = $self->app->config->{DecodeQueue}->{Type};
e0d6597078a5 Cleanup: Mojo-ize old code, simplifying perl OO code
Vincent Tondellier <tonton+hg@team1664.org>
parents: 32
diff changeset
    45
    if (my $e = $loader->load($decode_class)) {
e0d6597078a5 Cleanup: Mojo-ize old code, simplifying perl OO code
Vincent Tondellier <tonton+hg@team1664.org>
parents: 32
diff changeset
    46
        die ref $e ? "Exception: $e" : 'Not found!';
e0d6597078a5 Cleanup: Mojo-ize old code, simplifying perl OO code
Vincent Tondellier <tonton+hg@team1664.org>
parents: 32
diff changeset
    47
    }
e0d6597078a5 Cleanup: Mojo-ize old code, simplifying perl OO code
Vincent Tondellier <tonton+hg@team1664.org>
parents: 32
diff changeset
    48
e0d6597078a5 Cleanup: Mojo-ize old code, simplifying perl OO code
Vincent Tondellier <tonton+hg@team1664.org>
parents: 32
diff changeset
    49
    return $decode_class->new(
e0d6597078a5 Cleanup: Mojo-ize old code, simplifying perl OO code
Vincent Tondellier <tonton+hg@team1664.org>
parents: 32
diff changeset
    50
        config => $self->app->config->{DecodeQueue},
e0d6597078a5 Cleanup: Mojo-ize old code, simplifying perl OO code
Vincent Tondellier <tonton+hg@team1664.org>
parents: 32
diff changeset
    51
        dumper_config => $self->app->config->{Dumper},
e0d6597078a5 Cleanup: Mojo-ize old code, simplifying perl OO code
Vincent Tondellier <tonton+hg@team1664.org>
parents: 32
diff changeset
    52
        storage => $self->app->storage
e0d6597078a5 Cleanup: Mojo-ize old code, simplifying perl OO code
Vincent Tondellier <tonton+hg@team1664.org>
parents: 32
diff changeset
    53
    );
17
c91535b1db3e Move the decoding to a module, and had config to choose which module
Vincent Tondellier <tonton+hg@team1664.org>
parents: 16
diff changeset
    54
});
3
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    55
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    56
helper scm_file_link => sub {
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    57
    my ($self, $file, $line) = @_;
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    58
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    59
    return "" unless(defined($file));
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    60
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    61
    if($file =~ qr{([a-z]+):([a-z/.]+):(.+):(\d+)})
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    62
    {
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    63
        my ($scm, $repo, $scmpath, $rev) = ($1, $2, $3, $4);
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    64
        my $filename = File::Spec->splitpath($scmpath);
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    65
        my $scmrepo = "$scm:$repo";
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    66
        if(exists($config->{ScmLinks}->{$scmrepo})) {
16
76a5a48538e4 Use helper instead of using the full class name
Vincent Tondellier <tonton+hg@team1664.org>
parents: 12
diff changeset
    67
            return b($self->link_to("$filename:$line" =>
11
0bef3b8087c1 Move filesystem access to lib/
Vincent Tondellier <tonton+hg@team1664.org>
parents: 6
diff changeset
    68
                    $self->render(inline => $config->{ScmLinks}->{$scmrepo},
0bef3b8087c1 Move filesystem access to lib/
Vincent Tondellier <tonton+hg@team1664.org>
parents: 6
diff changeset
    69
                        repo => $repo, scmpath => $scmpath, rev => $rev, line => $line, partial => 1)
3
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    70
                ));
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    71
        }
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    72
        #return $file;
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    73
    }
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    74
    my $filebase = (File::Spec->splitpath($file))[-1];
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    75
    if(defined($line) && $line ne "") {
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    76
        return "$filebase:$line";
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    77
    }
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    78
    return $filebase;
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    79
};
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    80
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    81
helper shorten_signature => sub {
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    82
    my ($self, $signature) = @_;
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    83
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    84
    return "" if(!defined($signature) || $signature eq "");
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    85
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    86
    my $short_signature = $signature;
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    87
    if($signature =~ qr{([^<]+)<.+>::([^()]+)\(.*\)(.*)}) {
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    88
        # c++ with template
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    89
        $short_signature = "$1<>::$2()$3";
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    90
    } elsif($signature =~ qr{([^()]+)\(.*\)(.*)}) {
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    91
        # c/c++
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    92
        $short_signature = "$1()$2";
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    93
    }
16
76a5a48538e4 Use helper instead of using the full class name
Vincent Tondellier <tonton+hg@team1664.org>
parents: 12
diff changeset
    94
    return b($self->t(span => (title => $signature, class => "shortened-signature") => $short_signature));
3
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    95
};
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
    96
32
3e776f1b21d4 Fix and improve atom/rss feed
Vincent Tondellier <tonton+hg@team1664.org>
parents: 29
diff changeset
    97
helper xml_escape_block => sub {
3e776f1b21d4 Fix and improve atom/rss feed
Vincent Tondellier <tonton+hg@team1664.org>
parents: 29
diff changeset
    98
    my ($c, $block) = @_;
3e776f1b21d4 Fix and improve atom/rss feed
Vincent Tondellier <tonton+hg@team1664.org>
parents: 29
diff changeset
    99
    my $result = $block->();
3e776f1b21d4 Fix and improve atom/rss feed
Vincent Tondellier <tonton+hg@team1664.org>
parents: 29
diff changeset
   100
    $result = xml_escape $result;
3e776f1b21d4 Fix and improve atom/rss feed
Vincent Tondellier <tonton+hg@team1664.org>
parents: 29
diff changeset
   101
    return Mojo::ByteStream->new($result);
3e776f1b21d4 Fix and improve atom/rss feed
Vincent Tondellier <tonton+hg@team1664.org>
parents: 29
diff changeset
   102
};
3e776f1b21d4 Fix and improve atom/rss feed
Vincent Tondellier <tonton+hg@team1664.org>
parents: 29
diff changeset
   103
0
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
   104
get '/' => sub {
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
   105
    my $self = shift;
29
006e82a1bcd0 Add pagination
Vincent Tondellier <tonton+hg@team1664.org>
parents: 24
diff changeset
   106
    my $page = 1;
006e82a1bcd0 Add pagination
Vincent Tondellier <tonton+hg@team1664.org>
parents: 24
diff changeset
   107
    $self->validation->required('page')->like(qr/^[0-9]+$/);
006e82a1bcd0 Add pagination
Vincent Tondellier <tonton+hg@team1664.org>
parents: 24
diff changeset
   108
    $page = scalar $self->validation->param("page") if $self->validation->is_valid('page');
006e82a1bcd0 Add pagination
Vincent Tondellier <tonton+hg@team1664.org>
parents: 24
diff changeset
   109
006e82a1bcd0 Add pagination
Vincent Tondellier <tonton+hg@team1664.org>
parents: 24
diff changeset
   110
    my $result = $self->app->storage->index($page, 20);
006e82a1bcd0 Add pagination
Vincent Tondellier <tonton+hg@team1664.org>
parents: 24
diff changeset
   111
006e82a1bcd0 Add pagination
Vincent Tondellier <tonton+hg@team1664.org>
parents: 24
diff changeset
   112
    $self->stash(files => $result->{crashs});
006e82a1bcd0 Add pagination
Vincent Tondellier <tonton+hg@team1664.org>
parents: 24
diff changeset
   113
    $self->stash(pager => $result->{pager});
0
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
   114
    $self->render('index');
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
   115
} => 'index';
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
   116
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
   117
get '/report/:uuid' => [ uuid => qr/[0-9a-fA-F-]+/ ] => sub {
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
   118
    my $self = shift;
17
c91535b1db3e Move the decoding to a module, and had config to choose which module
Vincent Tondellier <tonton+hg@team1664.org>
parents: 16
diff changeset
   119
    $self->stash(processed_data => $self->app->storage->get_processed_data($self->param('uuid')));
0
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
   120
    $self->render('report/crash');
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
   121
} => 'report';
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
   122
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
   123
post '/submit' => sub {
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
   124
    my $self = shift;
3
2ff78fe4abda Create helper to shorten signatures and create links to the repository
Vincent Tondellier <tonton+hg@team1664.org>
parents: 1
diff changeset
   125
0
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
   126
    # save the dump in a file
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
   127
    my $file = $self->req->upload('upload_file_minidump');
17
c91535b1db3e Move the decoding to a module, and had config to choose which module
Vincent Tondellier <tonton+hg@team1664.org>
parents: 16
diff changeset
   128
    my %paramshash = map { $_ => $self->req->param($_) } $self->req->param;
c91535b1db3e Move the decoding to a module, and had config to choose which module
Vincent Tondellier <tonton+hg@team1664.org>
parents: 16
diff changeset
   129
0
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
   130
    my ($uuid, $uuidstr);
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
   131
    UUID::generate($uuid);
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
   132
    UUID::unparse($uuid, $uuidstr);
23
e621317229f7 Async submit.
Vincent Tondellier <tonton+hg@team1664.org>
parents: 19
diff changeset
   133
e621317229f7 Async submit.
Vincent Tondellier <tonton+hg@team1664.org>
parents: 19
diff changeset
   134
    $self->render_later();
0
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
   135
23
e621317229f7 Async submit.
Vincent Tondellier <tonton+hg@team1664.org>
parents: 19
diff changeset
   136
    $self->app->decode_queue->decode($file, \%paramshash, $uuidstr, sub {
e621317229f7 Async submit.
Vincent Tondellier <tonton+hg@team1664.org>
parents: 19
diff changeset
   137
            my $pjson = shift;
e621317229f7 Async submit.
Vincent Tondellier <tonton+hg@team1664.org>
parents: 19
diff changeset
   138
            # reply
e621317229f7 Async submit.
Vincent Tondellier <tonton+hg@team1664.org>
parents: 19
diff changeset
   139
            $self->render(text => $pjson->{status});
e621317229f7 Async submit.
Vincent Tondellier <tonton+hg@team1664.org>
parents: 19
diff changeset
   140
        }
e621317229f7 Async submit.
Vincent Tondellier <tonton+hg@team1664.org>
parents: 19
diff changeset
   141
    );
e621317229f7 Async submit.
Vincent Tondellier <tonton+hg@team1664.org>
parents: 19
diff changeset
   142
0
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
   143
};
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
   144
23
e621317229f7 Async submit.
Vincent Tondellier <tonton+hg@team1664.org>
parents: 19
diff changeset
   145
app->secrets([
e621317229f7 Async submit.
Vincent Tondellier <tonton+hg@team1664.org>
parents: 19
diff changeset
   146
    'My secret passphrase here'
e621317229f7 Async submit.
Vincent Tondellier <tonton+hg@team1664.org>
parents: 19
diff changeset
   147
]);
24
b69b7aa98a1d Add basic SQL Storage
Vincent Tondellier <tonton+hg@team1664.org>
parents: 23
diff changeset
   148
b69b7aa98a1d Add basic SQL Storage
Vincent Tondellier <tonton+hg@team1664.org>
parents: 23
diff changeset
   149
push @{app->commands->namespaces}, 'CrashTest::Commands';
0
5b78b8c79d9c Initial commit
Vincent Tondellier <tonton+hg@team1664.org>
parents:
diff changeset
   150
app->start;