File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -481,8 +481,12 @@ - (id) init
481
481
}];
482
482
});
483
483
// Wait for the event handler to call tryCommitTransaction
484
- dispatch_semaphore_wait (sema, DISPATCH_TIME_FOREVER);
485
- BOOL abort = [transactionState valueForKey: @" abort" ];
484
+ // WARNING: This wait occurs on the Firebase Worker Queue
485
+ // so if tryCommitTransaction fails to signal the semaphore
486
+ // no further blocks will be executed by Firebase until the timeout expires
487
+ dispatch_time_t delayTime = dispatch_time (DISPATCH_TIME_NOW, 30 * NSEC_PER_SEC);
488
+ BOOL timedout = dispatch_semaphore_wait (sema, delayTime);
489
+ BOOL abort = [transactionState valueForKey: @" abort" ] || timedout;
486
490
id value = [transactionState valueForKey: @" value" ];
487
491
dispatch_barrier_async (_transactionQueue, ^{
488
492
[_transactions removeObjectForKey: identifier];
You can’t perform that action at this time.
0 commit comments