Skip to content

Commit 4605a98

Browse files
committed
fix: stale ptd entries in items cache no longer breaks Export All
1 parent 0c469ba commit 4605a98

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

cls/SourceControl/Git/Production.cls

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,15 @@ ClassMethod ExportPTD(internalName As %String, nameMethod) As %Status
8787
Set name = $Piece(internalName,".",1,$Length(internalName,".")-1)
8888
Set $ListBuild(productionName, itemName) = $ListFromString(name, "||")
8989
Set $ListBuild(itemName, itemClassName) = $ListFromString(itemName, "|")
90+
Set sc = $$$OK
9091
If $Piece($Piece(name,"||",2),"|",2) = "" {
9192
Set sc = ..ExportProductionSettings(productionName, nameMethod)
9293
} Else {
9394
Set configItemName = productionName_"||"_$Piece(itemName, "Settings-", 2)_"|"_itemClassName
9495
Set item = ##class(Ens.Config.Production).OpenItemByConfigName(configItemName)
95-
Set sc = ..ExportConfigItemSettings(productionName, item, nameMethod)
96+
If $IsObject(item) {
97+
Set sc = ..ExportConfigItemSettings(productionName, item, nameMethod)
98+
}
9699
}
97100
Return sc
98101
}
@@ -115,7 +118,7 @@ ClassMethod ExportConfigItemSettings(productionClass As %String, item As %Regist
115118
/// class name
116119
ClassMethod ExportProductionSettings(productionClass As %String, nameMethod As %String) As %Status
117120
{
118-
set internalName = ..CreateInternalName(productionClass,,,0)
121+
set internalName = ..CreateInternalName(productionClass,,,1)
119122
Set class = ##class(%Dictionary.CompiledClass).%OpenId(productionClass)
120123
Set sc = ##class(Ens.Deployment.Utils).CreatePTDFromProduction(class, .ptdName)
121124
If $$$ISERR(sc) {

cls/SourceControl/Git/Utils.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1550,7 +1550,7 @@ ClassMethod ExportItem(InternalName As %String, expand As %Boolean = 1, force As
15501550
} else {
15511551
$$$QuitOnError($system.OBJ.ExportUDL(InternalName, filename,"-d/diff"))
15521552
}
1553-
if (filename '= "") {
1553+
if (filename '= "") && ##class(%File).Exists(filename) {
15541554
set filenames($I(filenames)) = filename
15551555
$$$QuitOnError(..UpdateRoutineTSH(InternalName, $h))
15561556
if '##class(SourceControl.Git.Change).IsUncommitted(filename) {

0 commit comments

Comments
 (0)