-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
113 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,38 @@ | ||
package App::Yath::Command::ui::importer; | ||
package App::Yath::Command::db::importer; | ||
use strict; | ||
use warnings; | ||
|
||
our $VERSION = '2.000000'; | ||
|
||
use Test2::Harness::UI; | ||
use Test2::Harness::UI::Config; | ||
use Test2::Harness::UI::Importer; | ||
sub summary { "Start an importer process that will wait for uploaded logs to import" } | ||
sub description { "Start an importer process that will wait for uploaded logs to import" } | ||
sub group { "db" } | ||
|
||
sub summary { "No Summary" } | ||
sub description { "No Description" } | ||
sub group { "ui" } | ||
use Test2::Harness::Schema::Loader; | ||
|
||
sub cli_args { } | ||
use Test2::Harness::Schema::Util qw/schema_config_from_settings/; | ||
|
||
sub run { | ||
use parent 'App::Yath::Command'; | ||
use Getopt::Yath; | ||
|
||
include_options( | ||
'App::Yath::Options::DB', | ||
); | ||
|
||
my ($dsn, $user, $pass, $seed) = @ARGV; | ||
sub run { | ||
my $self = shift; | ||
|
||
$user ||= ''; | ||
$pass ||= ''; | ||
my $settings = $self->settings; | ||
my $config = schema_config_from_settings($settings); | ||
|
||
srand($seed) if $seed; | ||
$SIG{INT} = sub { exit 0 }; | ||
$SIG{TERM} = sub { exit 0 }; | ||
|
||
my $config = Test2::Harness::UI::Config->new( | ||
dbi_dsn => $dsn, | ||
dbi_user => $user, | ||
dbi_pass => $pass, | ||
); | ||
Test2::Harness::UI::Importer->new(config => $config)->run; | ||
} | ||
|
||
1; | ||
|
||
$SIG{INT} = sub { exit 0 }; | ||
$SIG{TERM} = sub { exit 0 }; | ||
__END__ | ||
Test2::Harness::UI::Importer->new(config => $config)->run; | ||
=head1 POD IS AUTO-GENERATED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters