Changeset 1805


Ignore:
Timestamp:
06/28/16 19:13:18 (8 years ago)
Author:
nanardon
Message:

Mark sync point immediatelly after base sync and not after whole process

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Synchro.pm

    r1384 r1805  
    3131=cut 
    3232 
    33 our $VERSION = (q$Rev$ =~ /^Rev: (\d+) /)[0]; 
     33our $VERSION = (q$Rev: 1384 $ =~ /^Rev: (\d+) /)[0]; 
    3434 
    3535=head2 new($from, $to, %options) 
     
    170170    $self->from->wexported($state{$self->from->label}); 
    171171    foreach my $base (grep { $_ } $self->to) { 
    172         $base->commit; 
    173172        $base->wexported($state{$base->label}); 
    174173    } 
     
    395394            } 
    396395        } 
     396        if (!$desterror{$destbase->label}) { 
     397            $destbase->commit if(!$destbase->is_transactionnal); 
     398            $self->newval($self->from->label, $destbase->label, $self->{current_rev}); 
     399            if(!($self->{options}{nocreate} || $self->{options}{test})) { 
     400                $self->write_status; 
     401                la_log(LA_NOTICE, 
     402                    "Update synch. status to %d for base %s to %s", 
     403                    $self->{current_rev}, $self->from->label, $destbase->label 
     404                );  
     405            } 
     406        } 
    397407    } 
    398408 
     
    403413        } 
    404414    ); 
    405     if ($res) { 
    406         foreach my $destbase ($self->to) { 
    407             # don't register savepoint on error 
    408             if ($desterror{$destbase->label}) { next; } 
    409             $self->newval($self->from->label, $destbase->label, $self->{current_rev}); 
    410         } 
    411  
    412         if(!($self->{options}{nocreate} || 
    413                 $self->{options}{test})) { 
    414             $self->write_status; 
    415         } 
     415    if ($res) {  
    416416    } else { 
    417         la_log(LA_ERROR, "Not updating status because post script failed"); 
     417        la_log(LA_ERROR, "Post synchronization script failed: %s", $res); 
    418418    } 
    419419 
Note: See TracChangeset for help on using the changeset viewer.