line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::bif::drop::hub; |
2
|
1
|
|
|
1
|
|
4525
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
4
|
1
|
|
|
1
|
|
5
|
use Bif::Mo; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
7
|
|
5
|
1
|
|
|
1
|
|
764
|
use DBIx::ThinSQL qw/sq/; |
|
1
|
|
|
|
|
27440
|
|
|
1
|
|
|
|
|
10
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.1.5_7'; |
8
|
|
|
|
|
|
|
extends 'App::bif'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub run { |
11
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
12
|
1
|
|
|
|
|
6
|
my $opts = $self->opts; |
13
|
1
|
|
|
|
|
9
|
my $dbw = $self->dbw; |
14
|
0
|
|
|
|
|
|
my $info = $self->get_hub( $opts->{name} ); |
15
|
|
|
|
|
|
|
|
16
|
0
|
0
|
|
|
|
|
if ( !$opts->{force} ) { |
17
|
0
|
|
|
|
|
|
print "Nothing dropped (missing --force, -f)\n"; |
18
|
0
|
|
|
|
|
|
return $self->ok('DropNoForce'); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
my $uuid = substr( $info->{uuid}, 0, 8 ); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
$dbw->txn( |
24
|
|
|
|
|
|
|
sub { |
25
|
|
|
|
|
|
|
$dbw->xdo( |
26
|
|
|
|
|
|
|
delete_from => 'hubs', |
27
|
|
|
|
|
|
|
where => { id => $info->{id} }, |
28
|
0
|
|
|
0
|
|
|
); |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
print "Hub dropped: $info->{name} <$uuid>\n"; |
31
|
|
|
|
|
|
|
} |
32
|
0
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
return $self->ok('DropHub'); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
__END__ |