File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -445,7 +445,17 @@ let resync_host ~__context ~host =
445445 ) update_refs;
446446 Create_misc. create_updates_requiring_reboot_info ~__context ~host
447447 end
448- else Db.Host. set_updates ~__context ~self: host ~value: []
448+ else Db.Host. set_updates ~__context ~self: host ~value: [] ;
449+
450+ (* Remove any pool_patch objects that don't have a corresponding pool_update object *)
451+ Db.Pool_patch. get_all ~__context
452+ |> List. filter (fun self -> Db.Pool_patch. get_pool_update ~__context ~self = Ref. null)
453+ |> List. iter (fun self -> Db.Pool_patch. destroy ~__context ~self );
454+
455+ (* Clean updates that don't have a corresponding patch record *)
456+ Db.Pool_update. get_all ~__context
457+ |> List. filter (fun self -> Xapi_pool_patch. pool_patch_of_update ~__context self = Ref. null)
458+ |> List. iter (fun self -> destroy ~__context ~self )
449459
450460let pool_update_download_handler (req : Request.t ) s _ =
451461 debug " pool_update.pool_update_download_handler URL %s" req.Request. uri;
You can’t perform that action at this time.
0 commit comments