Skip to content

Commit

Permalink
Update src/darwin/Framework/CHIP/MTRDeviceController.mm
Browse files Browse the repository at this point in the history
Co-authored-by: Boris Zbarsky <[email protected]>
  • Loading branch information
woody-apple and bzbarsky-apple authored Jul 10, 2024
1 parent 0685340 commit f001bd1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/darwin/Framework/CHIP/MTRDeviceController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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<unsigned long>(deviceList.count));
});
Expand Down

0 comments on commit f001bd1

Please sign in to comment.