SL::DB::BackgroundJob::data_as_hash auch als Writer benutzen können
authorMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 14 Apr 2015 08:34:20 +0000 (10:34 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 14 Apr 2015 08:35:07 +0000 (10:35 +0200)
SL/DB/BackgroundJob.pm

index 2040297..3e6c03d 100644 (file)
@@ -75,6 +75,9 @@ sub run {
 
 sub data_as_hash {
   my $self = shift;
+
+  $self->data(YAML::Dump($_[0])) if @_;
+
   return {}                        if !$self->data;
   return $self->data               if ref($self->{data}) eq 'HASH';
   return YAML::Load($self->{data}) if !ref($self->{data});