Skip to content

Commit

Permalink
Do not wait forever to get fast enumeration state from file provider …
Browse files Browse the repository at this point in the history
…extension service

Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra authored and backportbot[bot] committed Jul 9, 2024
1 parent c802f1b commit d10ad17
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/gui/macOS/fileproviderxpc_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
#include "gui/macOS/fileproviderdomainmanager.h"
#include "gui/macOS/fileproviderxpc_mac_utils.h"

namespace {
constexpr int64_t semaphoreWaitDelta = 3000000000; // 3 seconds
}

namespace OCC::Mac {

Q_LOGGING_CATEGORY(lcFileProviderXPC, "nextcloud.gui.macos.fileprovider.xpc", QtInfoMsg)
Expand Down Expand Up @@ -154,7 +158,7 @@
receivedFastEnumerationSet = set;
dispatch_semaphore_signal(semaphore);
}];
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, semaphoreWaitDelta));
return std::optional<std::pair<bool, bool>>{{receivedFastEnumerationEnabled, receivedFastEnumerationSet}};
}

Expand Down

0 comments on commit d10ad17

Please sign in to comment.