X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/1b15807093421ca00493a447048b960f2f512152..3f21f766920411eeb17e21887943e6fb6ff43b5c:/SL/DB/BackgroundJob.pm 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; }