-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from techman83/cherry-pick_2015
Cherry pick 2015
- Loading branch information
Showing
4 changed files
with
71 additions
and
1 deletion.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package App::EventStreamr::DVswitch::Sync; | ||
use Method::Signatures; | ||
use Moo; | ||
use namespace::clean; | ||
|
||
# ABSTRACT: Sync | ||
|
||
# VERSION: Generated by DZP::OurPkg:Version | ||
|
||
=head1 SYNOPSIS | ||
Manage Sync process. | ||
=head1 DESCRIPTION | ||
Manage all the configured devices designated to be | ||
running as ingest roles. | ||
=cut | ||
|
||
extends 'App::EventStreamr::Sync'; | ||
|
||
1; |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package App::EventStreamr::Sync; | ||
use Method::Signatures; | ||
use POSIX 'strftime'; | ||
use Moo; | ||
use namespace::clean; | ||
|
||
# ABSTRACT: An EventStreamr Sync Process | ||
|
||
# VERSION: Generated by DZP::OurPkg:Version | ||
|
||
=head1 SYNOPSIS | ||
This manages the internal EventStreamr API | ||
=head1 DESCRIPTION | ||
This largely extends L<App::EventStreamr::Process>, provides | ||
default cmds that can be overridden in the configuration. | ||
=cut | ||
|
||
extends 'App::EventStreamr::Process'; | ||
|
||
has 'cmd' => ( is => 'ro', lazy => 1, builder => 1 ); | ||
has 'id' => ( is => 'ro', default => sub { 'sync' } ); | ||
has 'type' => ( is => 'ro', default => sub { 'sync' } ); | ||
|
||
# TODO: This is horrible, we handle date stuff in a terrible way. | ||
method _build_cmd() { | ||
$self->{status}{$self->{id}}{date} = strftime "%Y-%m-%d", localtime; | ||
|
||
$self->{status}{$self->{id}}{record_path} = $self->{config}{record_path}; | ||
|
||
my %cmd_vars = ( | ||
room => $self->{config}{room}, | ||
date => $self->{status}{$self->{id}}{date}, | ||
); | ||
|
||
$self->{status}{$self->{id}}{record_path} =~ s/\$(\w+)/$cmd_vars{$1}/g; | ||
|
||
# TODO: ... yucky. Improve this | ||
return "eventstreamr-sync.sh $self->{status}{$self->{id}}{record_path} $self->{config}{sync}{host} $self->{config}{sync}{path} $self->{config}{room} $self->{status}{$self->{id}}{date}"; | ||
} | ||
|
||
1; |