@@ -507,6 +507,17 @@ Method %Initialize(ByRef pParams) As %Status
507
507
{
508
508
Set status = $$$OK
509
509
Try {
510
+ Set preloadRoot = $Get (pParams (" RootDirectory" ))_" preload"
511
+ Set verbose = $Get (pParams (" Verbose" ))
512
+ If ##class (%File ).DirectoryExists (preloadRoot ) {
513
+ Set tSC = $System .OBJ .ImportDir (preloadRoot , " *" , $Select (verbose :" d" ,1 :" -d" )_$Select ($Tlevel :" /multicompile=0" , 1 : " " ), , 1 , .tImported )
514
+ If $$$ISERR(tSC ) { Quit }
515
+ Set tSC = ##class (%IPM.Utils.LegacyCompat ).UpdateSuperclassAndCompile (.tImported )
516
+ If $$$ISERR(tSC ) { Quit }
517
+ } ElseIf verbose {
518
+ Write !," Skipping preload - directory does not exist."
519
+ }
520
+
510
521
Set key = " "
511
522
For {
512
523
Set resource = ..Module .Resources .GetNext (.key )
@@ -596,16 +607,6 @@ Method %Reload(ByRef pParams) As %Status
596
607
597
608
$$$ThrowOnError(..InstallPythonRequirements (tRoot , .pParams ))
598
609
599
- Set tPreloadRoot = tRoot _" preload"
600
- If ##class (%File ).DirectoryExists (tPreloadRoot ) {
601
- Set tSC = $System .OBJ .ImportDir (tPreloadRoot , " *" , $Select (tVerbose :" d" ,1 :" -d" )_$Select ($Tlevel :" /multicompile=0" , 1 : " " ), , 1 , .tImported )
602
- If $$$ISERR(tSC ) { Quit }
603
- Set tSC = ##class (%IPM.Utils.LegacyCompat ).UpdateSuperclassAndCompile (.tImported )
604
- If $$$ISERR(tSC ) { Quit }
605
- } ElseIf tVerbose {
606
- Write !," Skipping preload - directory does not exist."
607
- }
608
-
609
610
// Reload the module definition
610
611
Set tSC = ..Module .%Reload ()
611
612
If $$$ISERR(tSC ) {
0 commit comments