From 807f617644c8dfa1d9bbe5b0e387599bb9d3bcdc Mon Sep 17 00:00:00 2001 From: tamassoltesz Date: Tue, 1 Oct 2024 16:01:03 +0200 Subject: [PATCH] fix: review fixes --- config.yaml | 5 +++-- devConfig.yaml | 4 ++-- .../java/io/supertokens/bulkimport/BulkImportUserUtils.java | 4 ++-- src/main/java/io/supertokens/config/CoreConfig.java | 4 +++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/config.yaml b/config.yaml index 970c69d5e..11d7d03d9 100644 --- a/config.yaml +++ b/config.yaml @@ -152,6 +152,7 @@ core_config_version: 0 # if there are more CUDs in the database and block all other CUDs from being used from this instance. # supertokens_saas_load_only_cud: -# (DIFFERENT_ACROSS_TENANTS | OPTIONAL | Default: 1) int value. If specified, the supertokens core will use the -# specified number of threads to complete the migration of users. +# (DIFFERENT_ACROSS_TENANTS | OPTIONAL | Default: number of available processor cores) int value. If specified, +# the supertokens core will use the specified number of threads to complete the migration of users. # bulk_migration_parallelism: + diff --git a/devConfig.yaml b/devConfig.yaml index cc47cc807..853cc8b6f 100644 --- a/devConfig.yaml +++ b/devConfig.yaml @@ -152,6 +152,6 @@ disable_telemetry: true # if there are more CUDs in the database and block all other CUDs from being used from this instance. # supertokens_saas_load_only_cud: -# (DIFFERENT_ACROSS_TENANTS | OPTIONAL | Default: 1) int value. If specified, the supertokens core will use the -# specified number of threads to complete the migration of users. +# (DIFFERENT_ACROSS_TENANTS | OPTIONAL | Default: number of available processor cores) int value. If specified, +# the supertokens core will use the specified number of threads to complete the migration of users. # bulk_migration_parallelism: diff --git a/src/main/java/io/supertokens/bulkimport/BulkImportUserUtils.java b/src/main/java/io/supertokens/bulkimport/BulkImportUserUtils.java index f2df6892e..7b70d27aa 100644 --- a/src/main/java/io/supertokens/bulkimport/BulkImportUserUtils.java +++ b/src/main/java/io/supertokens/bulkimport/BulkImportUserUtils.java @@ -264,8 +264,8 @@ private String validateAndNormaliseExternalUserId(String externalUserId, List 255) { - errors.add("externalUserId " + externalUserId + " is too long. Max length is 255."); + if (externalUserId.length() > 128) { + errors.add("externalUserId " + externalUserId + " is too long. Max length is 128."); } if (!allExternalUserIds.add(externalUserId)) { diff --git a/src/main/java/io/supertokens/config/CoreConfig.java b/src/main/java/io/supertokens/config/CoreConfig.java index d1384ae73..9e6957559 100644 --- a/src/main/java/io/supertokens/config/CoreConfig.java +++ b/src/main/java/io/supertokens/config/CoreConfig.java @@ -307,7 +307,9 @@ public class CoreConfig { @NotConflictingInApp @JsonProperty - private int bulk_migration_parallelism = 1; + @ConfigDescription("If specified, the supertokens core will use the specified number of threads to complete the " + + "migration of users. (Default: number of available processor cores).") + private int bulk_migration_parallelism = Runtime.getRuntime().availableProcessors(); public static Set getValidFields() { CoreConfig coreConfig = new CoreConfig();