RunCommandLogs: set a UUID automatically
This commit is contained in:
committed by
Cole Helbling
parent
89e8676d80
commit
dcb0c1425c
@ -174,9 +174,30 @@ __PACKAGE__->belongs_to(
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZVpYU6k3d/k/nitjpdgf/A
|
||||
|
||||
use POSIX qw(WEXITSTATUS WIFEXITED WIFSIGNALED WTERMSIG);
|
||||
use UUID4::Tiny qw(create_uuid_string);
|
||||
use Digest::SHA1 qw(sha1_hex);
|
||||
use Hydra::Model::DB;
|
||||
|
||||
|
||||
=head2 new
|
||||
|
||||
Initialize a new row object.
|
||||
|
||||
Sets the UUID automatically unless a UUID is specified in the attributes.
|
||||
|
||||
=cut
|
||||
sub new {
|
||||
my ($class, $attrs) = @_;
|
||||
|
||||
if (!defined $attrs->{uuid}) {
|
||||
$attrs->{uuid} = create_uuid_string();
|
||||
}
|
||||
|
||||
my $new = $class->next::method($attrs);
|
||||
|
||||
return $new;
|
||||
}
|
||||
|
||||
=head2 started
|
||||
|
||||
Update the row with the current timestamp as the start time.
|
||||
|
Reference in New Issue
Block a user