line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Plack::Middleware::DBIx::DisconnectAll; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
32145
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
108
|
|
4
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
78
|
|
5
|
3
|
|
|
3
|
|
85
|
use 5.008005; |
|
3
|
|
|
|
|
12
|
|
|
3
|
|
|
|
|
148
|
|
6
|
3
|
|
|
3
|
|
729
|
use parent qw/Plack::Middleware/; |
|
3
|
|
|
|
|
267
|
|
|
3
|
|
|
|
|
23
|
|
7
|
3
|
|
|
3
|
|
21574
|
use DBIx::DisconnectAll; |
|
3
|
|
|
|
|
38890
|
|
|
3
|
|
|
|
|
662
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub call { |
12
|
2
|
|
|
2
|
1
|
131867
|
my ( $self, $env) = @_; |
13
|
2
|
|
|
|
|
27
|
my $res = $self->app->($env); |
14
|
|
|
|
|
|
|
Plack::Util::response_cb($res, sub { |
15
|
2
|
|
|
2
|
|
62
|
my $res = shift; |
16
|
2
|
50
|
|
|
|
11
|
if ( defined $res->[2] ) { |
17
|
2
|
|
|
|
|
12
|
dbi_disconnect_all(); |
18
|
2
|
|
|
|
|
231
|
return; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
return sub { |
21
|
0
|
|
|
|
|
|
my $chunk = shift; |
22
|
0
|
0
|
|
|
|
|
if ( ! defined $chunk ) { |
23
|
0
|
|
|
|
|
|
dbi_disconnect_all(); |
24
|
0
|
|
|
|
|
|
return; |
25
|
|
|
|
|
|
|
} |
26
|
0
|
|
|
|
|
|
return $chunk; |
27
|
0
|
|
|
|
|
|
}; |
28
|
2
|
|
|
|
|
206
|
}); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
__END__ |