Skip to content

Commit 3ecc502

Browse files
committed
add DISABLE_EAGER_MUTEX_ACQUISITION bool
1 parent b3865fc commit 3ecc502

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

frontend/javascripts/viewer/model/sagas/saving/save_mutex_saga.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ const MUTEX_ACQUIRED_KEY = "AnnotationMutexAcquired";
1919
const RETRY_COUNT = 12;
2020
const ACQUIRE_MUTEX_INTERVAL = 1000 * 60;
2121

22+
// todop
23+
const DISABLE_EAGER_MUTEX_ACQUISITION = true;
24+
2225
type MutexLogicState = {
2326
isInitialRequest: boolean;
2427
doesHaveMutexFromBeginning: boolean;
@@ -27,9 +30,10 @@ type MutexLogicState = {
2730
};
2831

2932
export function* acquireAnnotationMutexMaybe(): Saga<void> {
30-
// todop
31-
return;
3233
yield* call(ensureWkReady);
34+
if (DISABLE_EAGER_MUTEX_ACQUISITION) {
35+
return;
36+
}
3337
const allowUpdate = yield* select((state) => state.annotation.restrictions.allowUpdate);
3438
if (!allowUpdate) {
3539
return;
@@ -133,7 +137,7 @@ function onMutexStateChanged(
133137
blockedByUser: APIUserCompact | null | undefined,
134138
) {
135139
if (canEdit) {
136-
Toast.close("MutexCouldNotBeAcquired");
140+
Toast.close(MUTEX_NOT_ACQUIRED_KEY);
137141
if (!isInitialRequest) {
138142
const message = (
139143
<React.Fragment>

0 commit comments

Comments
 (0)