Skip to content

Commit 9e083ea

Browse files
committed
fix: move preload from %Reload into %Initialize
1 parent e580764 commit 9e083ea

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/cls/IPM/Lifecycle/Base.cls

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,17 @@ Method %Initialize(ByRef pParams) As %Status
507507
{
508508
Set status = $$$OK
509509
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+
510521
Set key = ""
511522
For {
512523
Set resource = ..Module.Resources.GetNext(.key)
@@ -596,16 +607,6 @@ Method %Reload(ByRef pParams) As %Status
596607

597608
$$$ThrowOnError(..InstallPythonRequirements(tRoot, .pParams))
598609

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-
609610
// Reload the module definition
610611
Set tSC = ..Module.%Reload()
611612
If $$$ISERR(tSC) {

0 commit comments

Comments
 (0)