Changeset 1205


Ignore:
Timestamp:
12/28/12 15:05:22 (11 years ago)
Author:
nanardon
Message:

add reset checkpoint to Basessynchro, fixing #3

Location:
trunk/LATMOS-Accounts/lib/LATMOS/Accounts
Files:
2 edited

Legend:

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

    r1204 r1205  
    399399} 
    400400 
     401=head2 reset_checkpoint 
     402 
     403Reset checkpoint in status file to force full synchronisation 
     404 
     405=cut 
     406 
     407sub reset_checkpoint { 
     408    my ($self) = @_; 
     409    foreach my $destbase ($self->to) { 
     410            # don't register checkpoint on error 
     411        $self->newval($self->from->label, $destbase->label, 0); 
     412    } 
     413    $self->write_status; 
     414} 
     415 
    401416=head2 run_pre_synchro 
    402417 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Basessynchro.pm

    r1204 r1205  
    4949} 
    5050 
     51sub reset_checkpoint { 
     52    my ($self) = @_; 
     53    my $LA = LATMOS::Accounts->new($self->{config}, noacl => 1) or do { 
     54        la_log LA_ERR, "Cannot instantiate LA"; 
     55        return; 
     56    }; 
     57    my $sync = $LA->create_synchro( 
     58        $self->{syncname} || $LA->default_synchro_name, 
     59        test     => $self->{test}, 
     60    ) or do { 
     61       la_log LA_ERR, "cannot create sync object"; 
     62       return; 
     63    }; 
     64 
     65 
     66    $sync->reset_checkpoint 
     67} 
     68 
    51691; 
    5270 
Note: See TracChangeset for help on using the changeset viewer.