From ce787752777575a22cbebd2cf5fbaf962d6afec5 Mon Sep 17 00:00:00 2001 From: Anagh Hegde Date: Wed, 16 Aug 2023 18:28:45 +0530 Subject: [PATCH] chore: Analytics file lock stale time (#26276) --- .../main/java/com/appsmith/server/constants/ce/FieldNameCE.java | 2 ++ .../com/appsmith/server/exceptions/GlobalExceptionHandler.java | 1 + .../java/com/appsmith/server/services/ce/GitServiceCEImpl.java | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/constants/ce/FieldNameCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/constants/ce/FieldNameCE.java index 1099acd76b..6292e0b310 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/constants/ce/FieldNameCE.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/constants/ce/FieldNameCE.java @@ -185,4 +185,6 @@ public class FieldNameCE { public static final String GIT_HOSTING_PROVIDER = "gitHostingProvider"; public static final String IS_MERGEABLE = "isMergeable"; + + public static final String FILE_LOCK_DURATION = "fileLockDuration"; } diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/GlobalExceptionHandler.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/GlobalExceptionHandler.java index 832144592c..d0b79fbbaf 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/GlobalExceptionHandler.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/exceptions/GlobalExceptionHandler.java @@ -339,6 +339,7 @@ public class GlobalExceptionHandler { analyticsProps.put(FieldName.APPLICATION_ID, appId); } if (!fileTime.equals(0L)) { + analyticsProps.put(FieldName.FILE_LOCK_DURATION, fileTime); return sessionUserService .getCurrentUser() .flatMap(user -> analyticsService.sendEvent( diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/GitServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/GitServiceCEImpl.java index b883fa8c65..de5573640f 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/GitServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/GitServiceCEImpl.java @@ -2236,7 +2236,7 @@ public class GitServiceCEImpl implements GitServiceCE { .getGitApplicationMetadata() .getIsRepoPrivate(), false, - true)) + mergeStatusDTO.isMergeAble())) .then(Mono.just(mergeStatusDTO)))) .onErrorResume(error -> { try {