Skip to content

Commit 389ec90

Browse files
committed
Use async api to preload user, installation, config on SDK initialization.
1 parent b0d29ac commit 389ec90

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Parse/Internal/ParseManager.m

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -427,12 +427,15 @@ - (BFTask *)preloadDiskObjectsToMemoryAsync {
427427
@weakify(self);
428428
return [BFTask taskFromExecutor:[BFExecutor executorWithDispatchQueue:_preloadQueue] withBlock:^id{
429429
@strongify(self);
430-
[PFUser currentUser];
431-
[PFConfig currentConfig];
430+
431+
NSArray *tasks = @[
432+
[PFUser getCurrentUserInBackground],
433+
[PFConfig getCurrentConfigInBackground],
432434
#if !TARGET_OS_WATCH && !TARGET_OS_TV
433-
[PFInstallation currentInstallation];
435+
[PFInstallation getCurrentInstallationInBackground],
434436
#endif
435-
437+
];
438+
[[BFTask taskForCompletionOfAllTasks:tasks] waitUntilFinished]; // Wait synchronously to make sure we are blocking preload queue.
436439
[self eventuallyQueue];
437440

438441
return nil;

0 commit comments

Comments
 (0)