diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/RedisUtils.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/RedisUtils.java index dca07fd712..5cd268f882 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/RedisUtils.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/RedisUtils.java @@ -1,5 +1,7 @@ package com.appsmith.server.helpers; +import com.appsmith.server.exceptions.AppsmithError; +import com.appsmith.server.exceptions.AppsmithException; import lombok.RequiredArgsConstructor; import org.springframework.data.redis.core.ReactiveRedisOperations; import org.springframework.stereotype.Component; @@ -17,14 +19,12 @@ public class RedisUtils { private static final Duration FILE_LOCK_TIME_LIMIT = Duration.ofSeconds(20); public Mono addFileLock(String key) { - // TODO Remove this once we are sure that the file lock is working as expected. - return Mono.just(true); - /*return redisOperations.hasKey(key).flatMap(isKeyPresent -> { + return redisOperations.hasKey(key).flatMap(isKeyPresent -> { if (Boolean.TRUE.equals(isKeyPresent)) { return Mono.error(new AppsmithException(AppsmithError.GIT_FILE_IN_USE)); } return redisOperations.opsForValue().set(key, REDIS_FILE_LOCK_VALUE, FILE_LOCK_TIME_LIMIT); - });*/ + }); } public Mono releaseFileLock(String key) {