diff options
author | ivan <ivan> | 2001-10-23 20:53:06 +0000 |
---|---|---|
committer | ivan <ivan> | 2001-10-23 20:53:06 +0000 |
commit | 6f325cd8d38905b98c6f11a64701653bdd9f9fcf (patch) | |
tree | 3a82db3ac0953c7ad3bbbe256d04ff41b8928911 | |
parent | 68a1b014aea963c2c94316fa34ec9a5dd135d102 (diff) |
Pg: FOR UPDATE LIMIT 1
mysql: LIMIT 1 FOR UPDATE
greeeat.
-rw-r--r-- | FS/bin/freeside-queued | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/FS/bin/freeside-queued b/FS/bin/freeside-queued index 35728db53..4e3724e6e 100644 --- a/FS/bin/freeside-queued +++ b/FS/bin/freeside-queued @@ -7,7 +7,7 @@ use Fcntl qw(:flock); use POSIX qw(setsid); use Date::Format; use IO::File; -use FS::UID qw(adminsuidsetup forksuidsetup); +use FS::UID qw(adminsuidsetup forksuidsetup driver_name); use FS::Record qw(qsearchs); use FS::queue; @@ -48,7 +48,9 @@ while (1) { 'queue', { 'status' => 'new' }, '', - 'ORDER BY jobnum FOR UPDATE LIMIT 1' + driver_name =~ /^mysql$/i + ? 'ORDER BY jobnum LIMIT 1 FOR UPDATE' + : 'ORDER BY jobnum FOR UPDATE LIMIT 1' ) or do { sleep 5; next; @@ -76,7 +78,7 @@ while (1) { #get new db handles $FS::UID::dbh->{InactiveDestroy} = 1; - $FS::svc_acct::icradius_dbh->{InactiveDestroy} + $FS::svc_acct::icradius_dbh->{InactiveDestroy} = 1 if $FS::svc_acct::icradius_dbh; forksuidsetup($user); |