X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FBackgroundJob.pm;h=3e6c03da58790873838ffee50debbdb6ef82c221;hb=9c5f94c0359a8f2c0dba93b5e9bdef99f332fcc8;hp=10e319ba396de6ef8cd7a38c3b28e8f41e5e3250;hpb=1b15807093421ca00493a447048b960f2f512152;p=kivitendo-erp.git diff --git a/SL/DB/BackgroundJob.pm b/SL/DB/BackgroundJob.pm index 10e319ba3..3e6c03da5 100644 --- a/SL/DB/BackgroundJob.pm +++ b/SL/DB/BackgroundJob.pm @@ -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}); @@ -84,9 +87,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; }