@@ -216,24 +216,29 @@ class AdminForth implements IAdminForth {
216216 let activationLoopCounter = 0 ;
217217 while ( true ) {
218218 activationLoopCounter ++ ;
219- if ( activationLoopCounter > 1000 ) {
220- throw new Error ( 'Plugin activation loop exceeded 1000 iterations, possible infinite loop (some plugin tries to activate himself in a loop)' ) ;
219+ if ( activationLoopCounter > 10 ) {
220+ throw new Error ( 'Plugin activation loop exceeded 10 iterations, possible infinite loop (some plugin tries to activate himself in a loop)' ) ;
221221 }
222- const allPluginsAreActivated = allPluginInstances . length === this . activatePlugins . length ;
222+ process . env . HEAVY_DEBUG && console . log ( `🔌 Plugin activation loop iteration: ${ activationLoopCounter } ` ) ;
223+ process . env . HEAVY_DEBUG && console . log ( `🔌 Activated plugins count: ${ this . activatedPlugins . length } /${ allPluginInstances . length } ` ) ;
224+ const allPluginsAreActivated = allPluginInstances . length === this . activatedPlugins . length ;
223225 if ( allPluginsAreActivated ) {
224226 break ;
225227 }
226-
228+
227229 const unactivatedPlugins = allPluginInstances . filter ( ( { pi : pluginInstance } ) =>
228230 ! this . activatedPlugins . find ( ( p ) => p . pluginInstanceId === pluginInstance . pluginInstanceId )
229231 ) ;
232+
233+ process . env . HEAVY_DEBUG && console . log ( `🔌 Unactivated plugins remaining: ${ unactivatedPlugins . length } ` ) ;
230234
231235 process . env . HEAVY_DEBUG && console . log ( `🔌 Unactivated plugins count: ${ unactivatedPlugins . length } ` ) ;
232236
233237 unactivatedPlugins . sort ( ( { pi : a } , { pi : b } ) => a . activationOrder - b . activationOrder ) ;
234-
238+ process . env . HEAVY_DEBUG && console . log ( `🔌 Activating plugins in order:` , unactivatedPlugins . map ( ( { pi } ) => pi . constructor . name ) ) ;
235239 unactivatedPlugins . forEach (
236240 ( { pi : pluginInstance , resource} , index ) => {
241+ process . env . HEAVY_DEBUG && console . log ( "Activating plugin:" , pluginInstance . constructor . name )
237242 process . env . HEAVY_DEBUG && console . log ( `🔌 Activating plugin ${ index + 1 } /${ allPluginInstances . length } : ${ pluginInstance . constructor . name } for resource ${ resource . resourceId } ` ) ;
238243 pluginInstance . modifyResourceConfig ( this , resource , allPluginInstances ) ;
239244 process . env . HEAVY_DEBUG && console . log ( `🔌 Plugin ${ pluginInstance . constructor . name } modifyResourceConfig completed` ) ;
@@ -249,6 +254,7 @@ class AdminForth implements IAdminForth {
249254 process . env . HEAVY_DEBUG && console . log ( `🔌 Plugin ${ pluginInstance . constructor . name } activated successfully` ) ;
250255 }
251256 ) ;
257+ process . env . HEAVY_DEBUG && console . log ( `🔌activated plugins:` , this . activatedPlugins . map ( ( pi ) => pi . constructor . name ) ) ;
252258 }
253259 process . env . HEAVY_DEBUG && console . log ( '🔌 All plugins activation completed' ) ;
254260 }
0 commit comments