Skip to content

Commit c2d69c0

Browse files
Updated persistence logic after review
Signed-off-by: Manikandan251995 <[email protected]>
1 parent 0c1c5c6 commit c2d69c0

File tree

3 files changed

+457
-1
lines changed

3 files changed

+457
-1
lines changed

simulator/folder.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ func folderPutChild(ctx *Context, f *mo.Folder, o mo.Entity) {
8181
// Need to update ChildEntity before Map.Put for ContainerView updates to work properly
8282
f.ChildEntity = append(f.ChildEntity, ctx.Map.reference(o))
8383
ctx.Map.PutEntity(f, o)
84-
84+
if ActiveModel != nil {
85+
ActiveModel.MarkDirty()
86+
}
8587
folderUpdate(ctx, f, o, ctx.Map.AddReference)
8688

8789
switch e := o.(type) {
@@ -98,6 +100,9 @@ func folderPutChild(ctx *Context, f *mo.Folder, o mo.Entity) {
98100

99101
func folderRemoveChild(ctx *Context, f *mo.Folder, o mo.Reference) {
100102
ctx.Map.Remove(ctx, o.Reference())
103+
if ActiveModel != nil {
104+
ActiveModel.MarkDirty()
105+
}
101106
folderRemoveReference(ctx, f, o)
102107
}
103108

0 commit comments

Comments
 (0)