[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
mark.
Files modified:
Fix up ljumover, it was failing after one iteration and not properly locking
users.
Patch by
![[staff profile]](https://www.dreamwidth.org/img/silk/identity/user_staff.png)
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 { --------------------------------------------------------------------------------