]> wagnertech.de Git - mfinanz.git/blobdiff - SL/DB/BackgroundJob.pm
SL::DB::BackgroundJob: refactoring von set_data für mehr programmatische Sicherheit
[mfinanz.git] / SL / DB / BackgroundJob.pm
index 10e319ba396de6ef8cd7a38c3b28e8f41e5e3250..2040297b10e13fd8bc3f58951067ab35ad2f3087 100644 (file)
@@ -84,9 +84,10 @@ sub data_as_hash {
 sub set_data {
   my ($self, %data) = @_;
 
-  my $data = YAML::Load($self->data);
-  $data->{$_} = $data{$_} for keys %data;
-  $self->data(YAML::Dump($data));
+  $self->data(YAML::Dump({
+    %{ $self->data_as_hash },
+    %data,
+  }));
 
   $self;
 }