[freeside-commits] freeside/FS/FS Schema.pm, 1.160, 1.161 queue.pm, 1.24, 1.25 queue_arg.pm, 1.4, 1.5
Jeff Finucane,420,,
jeff at wavetail.420.am
Sat Aug 1 12:16:49 PDT 2009
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv21642/FS/FS
Modified Files:
Schema.pm queue.pm queue_arg.pm
Log Message:
support broader array of queue args #5855, fallout from #5495
Index: Schema.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Schema.pm,v
retrieving revision 1.160
retrieving revision 1.161
diff -u -d -r1.160 -r1.161
--- Schema.pm 30 Jul 2009 06:42:31 -0000 1.160
+++ Schema.pm 1 Aug 2009 19:16:47 -0000 1.161
@@ -1622,6 +1622,7 @@
'columns' => [
'argnum', 'serial', '', '', '', '',
'jobnum', 'int', '', '', '', '',
+ 'frozen', 'char', 'NULL', 1, '', '',
'arg', 'text', 'NULL', '', '', '',
],
'primary_key' => 'argnum',
Index: queue_arg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/queue_arg.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- queue_arg.pm 18 Feb 2006 02:11:44 -0000 1.4
+++ queue_arg.pm 1 Aug 2009 19:16:47 -0000 1.5
@@ -36,6 +36,8 @@
=item jobnum - see L<FS::queue>
+=item frozen - argument is frozen with Storable
+
=item arg - argument
=back
@@ -96,6 +98,7 @@
my $error =
$self->ut_numbern('argnum')
|| $self->ut_numbern('jobnum')
+ || $self->ut_enum('frozen', [ '', 'Y' ])
|| $self->ut_anything('arg')
;
return $error if $error;
Index: queue.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/queue.pm,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- queue.pm 3 Mar 2009 23:41:03 -0000 1.24
+++ queue.pm 1 Aug 2009 19:16:47 -0000 1.25
@@ -3,6 +3,8 @@
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 @@
}
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 @@
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
More information about the freeside-commits
mailing list