source:
trunk/LATMOS-Accounts/patchset/no_useless_load.patch
@
1457
Last change on this file since 1457 was 792, checked in by nanardon, 14 years ago | |
---|---|
File size: 1.9 KB |
-
lib/LATMOS/Accounts/Synchro.pm
This patch avoid load() on base to be call several time. Bases are supposed to be load by end point script and not lazilly to check access is OK. The problem with this patch is we need to check all tools to verify load() is really called :\ Dangerous at time.
75 75 foreach (ref($to) eq 'ARRAY' ? @{ $to || []} : ($to)) { 76 76 push(@{$self->{to}}, $_); 77 77 } 78 bless($self, $class) 78 bless($self, $class); 79 $self->from->load or return; 80 return $self; 79 81 } 80 82 81 83 sub name { … … 103 105 my ($self) = @_; 104 106 my @loaded; 105 107 my $unloaded = 0; 108 106 109 foreach ($self->to) { 107 110 if($_->load) { 108 111 push(@loaded, $_); … … 117 120 118 121 sub enter_synch_mode { 119 122 my ($self) = @_; 120 $self->from->load or return;123 # $self->from->load or return; 121 124 # if any cannot be loaded, return, 122 125 # TODO we need a way to force if some still can be sync 123 $self->load_dest and return; 126 124 127 my %state = (); 125 128 $state{$self->from->label} = $self->from->wexported(0); 126 129 foreach ($self->to) { -
lib/LATMOS/Accounts.pm
156 156 la_log(LA_WARN, "Cannot instanciate base $section ($type)"); 157 157 return; 158 158 }; 159 $base->load or return;160 159 $base; 161 160 } 162 161 … … 234 233 ); 235 234 } 236 235 236 my @unload = grep { ! $_->load } @obases; 237 if (@unload) { 238 la_log(LA_ERR, "Cannot load base part of syncaccess %s", join(', ', map 239 { $_->label } @unload)); 240 return; 241 } 237 242 LATMOS::Accounts::SynchAccess->new([ @obases ]); 238 243 } 239 244
Note: See TracBrowser
for help on using the repository browser.