mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2009-04-18 07:36 pm

[dw-free] Fix up ljumover, it was failing after one iteration and not properly locking users.

[commit: http://hg.dwscoalition.org/dw-free/rev/e5e9e14b894b]

Fix up ljumover, it was failing after one iteration and not properly locking
users.

Patch by [staff profile] mark.

Files modified:
  • bin/ljumover.pl
--------------------------------------------------------------------------------
diff -r fc47183bbb0b -r e5e9e14b894b bin/ljumover.pl
--- a/bin/ljumover.pl	Sat Apr 18 11:34:07 2009 +0000
+++ b/bin/ljumover.pl	Sat Apr 18 19:36:47 2009 +0000
@@ -931,8 +931,8 @@ sub start {
         $self->message( "Unlocking %d remaining users.", values %{$self->{userThreads}} );
 
         foreach my $thread ( values %{$self->{userThreads}} ) {
+            LJ::disconnect_dbs();
             $thread->unlock;
-            LJ::disconnect_dbs();
             my $dbh = LJ::get_db_writer() or die "Couldn't get a db_writer.";
             $dbh->do( "DELETE FROM clustermove_inprogress WHERE userid = ?",
                       undef, $thread->userid )
@@ -962,8 +962,8 @@ sub reapChildren {
         $self->{fakeMovedUsers}{$thread->userid} = 1 if $thread->testingMode;
         delete $self->{userThreads}{$thread->userid};
 
+        LJ::disconnect_dbs();
         $thread->unlock;
-        LJ::disconnect_dbs();
         my $dbh = LJ::get_db_writer() or die "Couldn't get a db_writer.";
         $dbh->do( "DELETE FROM clustermove_inprogress WHERE userid = ?",
                   undef, $thread->userid )
@@ -1236,6 +1236,7 @@ sub new {
     my ( $user, $userid, $src, $dest ) = @_;
 
     # Lock the user
+    LJ::disconnect_dbs();
     LJ::update_user( $userid, {raw => "caps=caps|(1<<$ReadOnlyBit)"} );
 
     return bless {
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org