Changeset 1824 for trunk/LATMOS-Accounts/lib/LATMOS/Accounts/SyncManager.pm
- Timestamp:
- 07/11/16 14:43:44 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LATMOS-Accounts/lib/LATMOS/Accounts/SyncManager.pm
r1742 r1824 121 121 } 122 122 123 =head2 process_module($module) 124 125 Process C<$module>. 126 127 =cut 128 129 # TODO what is $dbrev, why is it need here ?? 130 131 sub process_module { 132 my ($self, $module) = @_; 133 134 eval { 135 if (!$self->ini->SectionExists($module)) { 136 la_log LA_ERR, "Cannot run inexistant module %s", $module; 137 return; 138 } 139 123 124 =head2 listSortedModules 125 126 List configured module ordered for running 127 128 =cut 129 130 sub listSortedModules { 131 my ($self) = @_; 132 133 my %modules = (); 134 135 foreach my $module ($self->list_modules) { 136 $modules{$module} = 1; 140 137 my $modtype = $self->ini->val($module, 'type', $module); 141 138 my $task = LATMOS::Accounts::Task->new( … … 147 144 or do { 148 145 la_log(LA_ERR, 'Cannot load module %s', $modtype); 146 next; 147 }; 148 149 $modules{$module} = $task->order; 150 } 151 152 return sort { $modules{$a} <=> $modules{$b} } keys %modules; 153 } 154 155 =head2 process_module($module) 156 157 Process C<$module>. 158 159 =cut 160 161 # TODO what is $dbrev, why is it need here ?? 162 163 sub process_module { 164 my ($self, $module) = @_; 165 166 eval { 167 if (!$self->ini->SectionExists($module)) { 168 la_log LA_ERR, "Cannot run inexistant module %s", $module; 169 return; 170 } 171 172 my $modtype = $self->ini->val($module, 'type', $module); 173 my $task = LATMOS::Accounts::Task->new( 174 $modtype, 175 config => $self->{config}, 176 name => $module, 177 syncm => $self, 178 ) 179 or do { 180 la_log(LA_ERR, 'Cannot load module %s', $modtype); 149 181 return; 150 182 };
Note: See TracChangeset
for help on using the changeset viewer.