[freeside-commits] freeside/FS/FS prepay_credit.pm,1.11,1.12
Ivan,,,
ivan at wavetail.420.am
Mon Jun 20 16:50:54 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv21927
Modified Files:
prepay_credit.pm
Log Message:
some debugging for prepaid card generation, and retry more, RT#13329
Index: prepay_credit.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/prepay_credit.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -w -d -r1.11 -r1.12
--- prepay_credit.pm 9 Mar 2010 21:57:52 -0000 1.11
+++ prepay_credit.pm 20 Jun 2011 23:50:52 -0000 1.12
@@ -1,12 +1,15 @@
package FS::prepay_credit;
use strict;
-use vars qw( @ISA );
+use vars qw( @ISA $DEBUG $me );
use FS::Record qw(qsearchs dbh);
use FS::agent;
@ISA = qw(FS::Record);
+$DEBUG = 0;
+$me = '[FS::prepay_credit]';
+
=head1 NAME
FS::prepay_credit - Object methods for prepay_credit records
@@ -170,7 +173,16 @@
my $identifier = join('', map($codeset[int(rand $#codeset)], (1..$length) ) );
- redo if qsearchs('prepay_credit',{identifier=>$identifier}) && $condup++<23;
+ if ( qsearchs('prepay_credit',{identifier=>$identifier}) ) {
+ if ( $condup++ < 54 ) {
+ warn "$me generate: duplicate identifier $identifier; retrying\n"
+ if $DEBUG;
+ redo;
+ } else {
+ warn "$me generate: giving up after 54 tries"
+ if $DEBUG;
+ }
+ }
$condup = 0;
my $prepay_credit = new FS::prepay_credit {
More information about the freeside-commits
mailing list