Changeset 1201 for trunk/LATMOS-Accounts/lib/LATMOS
- Timestamp:
- 12/27/12 18:26:32 (12 years ago)
- Location:
- trunk/LATMOS-Accounts/lib/LATMOS/Accounts
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/SyncManager.pm
r1200 r1201 190 190 } 191 191 192 =head2 reset_module_checkpoint($module) 193 194 Reset the checkpoint for module C<$module> to force it to run at next 195 synchronisation. 196 197 =cut 198 199 sub reset_module_checkpoint { 200 my ($self, $module) = @_; 201 if (!$self->ini->SectionExists($module)) { 202 la_log LA_ERR, "Cannot run inexistant module %s", $module; 203 return; 204 } 205 206 my $modtype = $self->ini->val($module, 'type', $module); 207 my $task = LATMOS::Accounts::Task->new( 208 $modtype, 209 config => $self->{config}, 210 name => $module, 211 syncm => $self, 212 ) 213 or do { 214 la_log(LA_ERR, 'Cannot load module %s', $modtype); 215 return; 216 }; 217 $task->init or do { 218 la_log LA_ERR, "Cannot init module %s", $_; 219 return; 220 }; 221 222 my $ini = $self->_load_state_ini or return; 223 224 $ini->delval($module, 'rev'); 225 $ini->newval($module, 'time', 0); 226 $ini->SetParameterComment( 227 $module, 'time', 228 'Reset to 0 the ' . scalar(localtime(time)), 229 ); 230 231 $task->reset_checkpoint; # Specific reset 232 $ini->RewriteConfig; 233 } 234 192 235 1; 193 236 -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task.pm
r1200 r1201 90 90 } 91 91 92 =head2 reset_checkpoint 93 94 Reset the checkpoint to 0 to force the module to be run again 95 96 =cut 97 98 sub reset_checkpoint { 99 return 1; 100 } 101 92 102 1; 93 103 -
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Task/Buildnet.pm
r1195 r1201 814 814 } 815 815 816 sub reset_checkpoint { 817 my ($self) = @_; 818 foreach my $zone ($self->_base->search_objects('netzone')) { 819 my $ozone = $self->_base->get_object('netzone', $zone) 820 or next; 821 822 $self->_bnet_state->newval($ozone->id, 'dbrev', 0); 823 la_log LA_DEBUG, "Zone checkpoint reset for %s", $ozone->id; 824 $self->_bnet_state->SetParameterComment( 825 $ozone->id, 'dbrev', 826 'Reset checkpoint the ' . scalar(localtime)); 827 } 828 829 $self->_write_state_file; 830 } 831 816 832 1; 817 833
Note: See TracChangeset
for help on using the changeset viewer.