X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FBackgroundJob.pm;h=3e6c03da58790873838ffee50debbdb6ef82c221;hb=2bb452ee62e74c2a42113171eeb53de8d09bbbf5;hp=10e319ba396de6ef8cd7a38c3b28e8f41e5e3250;hpb=cff0e9be7e6925c22dab7cb0b52ab9e23af0d56a;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; }