X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fqueue.pm;h=1f2abe3ae4ef3e2b640ca04ce8c1fd0634f64731;hp=381e418c9358105d05656d9486ab7e4f82df2b8a;hb=9f64bfef652922b7b546a12290805710acbeed08;hpb=7f43bf155bc79e3c9bd5d88e53117595963c301e diff --git a/FS/FS/queue.pm b/FS/FS/queue.pm index 381e418c9..1f2abe3ae 100644 --- a/FS/FS/queue.pm +++ b/FS/FS/queue.pm @@ -3,6 +3,8 @@ package FS::queue; use strict; use vars qw( @ISA @EXPORT_OK $DEBUG $conf $jobnums); use Exporter; +use MIME::Base64; +use Storable qw( nfreeze thaw ); use FS::UID qw(myconnect); use FS::Conf; use FS::Record qw( qsearch qsearchs dbh ); @@ -142,9 +144,11 @@ sub insert { } foreach my $arg ( @args ) { + my $freeze = ref($arg) ? 'Y' : ''; my $queue_arg = new FS::queue_arg ( { 'jobnum' => $self->jobnum, - 'arg' => $arg, + 'frozen' => $freeze, + 'arg' => $freeze ? encode_base64(nfreeze($arg)) : $arg,# always freeze? } ); $error = $queue_arg->insert; if ( $error ) { @@ -254,11 +258,12 @@ Returns a list of the arguments associated with this job. sub args { my $self = shift; - map $_->arg, qsearch( 'queue_arg', - { 'jobnum' => $self->jobnum }, - '', - 'ORDER BY argnum' - ); + map { $_->frozen ? thaw(decode_base64($_->arg)) : $_->arg } + qsearch( 'queue_arg', + { 'jobnum' => $self->jobnum }, + '', + 'ORDER BY argnum' + ); } =item cust_svc