sunnyman's (sunnyman) wrote in changelog,
sunnyman's
sunnyman
changelog

[livejournal] r20927: LJSUP-10483: LJ:get_lock bug fixed: now ...

Committer: vtroitsky
LJSUP-10483: LJ:get_lock bug fixed: now return undef in case of not acquiring lock during wait_time
U   trunk/cgi-bin/ljdb.pl
Modified: trunk/cgi-bin/ljdb.pl
===================================================================
--- trunk/cgi-bin/ljdb.pl	2012-01-18 11:36:09 UTC (rev 20926)
+++ trunk/cgi-bin/ljdb.pl	2012-01-18 13:24:28 UTC (rev 20927)
@@ -447,8 +447,8 @@
 
     # get a lock from mysql
     $wait_time ||= 10;
-    $db->do("SELECT GET_LOCK(?,?)", undef, $lockname, $wait_time)
-        or return undef;
+    my ($got) = $db->selectrow_array( 'SELECT GET_LOCK(?,?)', undef, $lockname, $wait_time );
+    return undef unless $got;
 
     # successfully got a lock
     $LJ::LOCK_OUT{$dbrole} = $curr_sub;

Tags: livejournal, pl, sunnyman, vtroitsky
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments