From f001bd15b06cc623cd70211c4e9a4ee7a3ba9695 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Tue, 9 Jul 2024 16:21:20 -1000 Subject: [PATCH] Update src/darwin/Framework/CHIP/MTRDeviceController.mm Co-authored-by: Boris Zbarsky --- src/darwin/Framework/CHIP/MTRDeviceController.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index f9cf8c8a4a080f..643ea407f287df 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -615,7 +615,10 @@ - (BOOL)startup:(MTRDeviceControllerStartupParamsInternal *)startupParams } #define kSecondsToWaitBeforeAPIClientRetainsMTRDevice 60 - // Keep the devices retained for a while, in case API client doesn't immedieately retain them + // Keep the devices retained for a while, in case API client doesn't immediately retain them. + // + // Note that this is just an optimization to avoid throwing the information away and immediately + // re-reading it from storage. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (kSecondsToWaitBeforeAPIClientRetainsMTRDevice * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ MTR_LOG("MTRDeviceController: un-retain devices loaded at startup %lu", static_cast(deviceList.count)); });