diff --git a/services/clsi/app/js/CLSICacheHandler.js b/services/clsi/app/js/CLSICacheHandler.js index 0f97a889b1..c9de59d52f 100644 --- a/services/clsi/app/js/CLSICacheHandler.js +++ b/services/clsi/app/js/CLSICacheHandler.js @@ -34,8 +34,8 @@ const MAX_ENTRIES_IN_OUTPUT_TAR = 100 const MAX_BLG_FILES = 50 const OBJECT_ID_REGEX = /^[0-9a-f]{24}$/ -const MIGRATE_FROM = new Date('2026-01-14').getTime() -const MIGRATE_UNTIL = new Date('2026-01-21').getTime() +const MIGRATE_FROM = Settings.apis.clsiCache.reshardFrom +const MIGRATE_UNTIL = Settings.apis.clsiCache.reshardUntil /** * @param {string} projectId @@ -55,8 +55,7 @@ function getAvailableShard(projectId) { const now = Date.now() if ( now > MIGRATE_FROM && - now < MIGRATE_UNTIL && - (counter % 100) / 100 < + (counter % 100) / 100 > (MIGRATE_UNTIL - now) / (MIGRATE_UNTIL - MIGRATE_FROM) ) { shards = Settings.apis.clsiCache.shards.slice( diff --git a/services/clsi/config/settings.defaults.cjs b/services/clsi/config/settings.defaults.cjs index 693194c1f4..bf0e7df63c 100644 --- a/services/clsi/config/settings.defaults.cjs +++ b/services/clsi/config/settings.defaults.cjs @@ -61,6 +61,10 @@ module.exports = { shards: JSON.parse(process.env.CLSI_CACHE_INSTANCES || '[]').filter( ({ zone, readOnly }) => zone === process.env.ZONE && !readOnly ), + currentShards: parseInt(process.env.CLSI_CACHE_CURRENT_SHARDS, 10), + desiredShards: parseInt(process.env.CLSI_CACHE_DESIRED_SHARDS, 10), + reshardFrom: new Date(process.env.CLSI_CACHE_RESHARD_FROM), + reshardUntil: new Date(process.env.CLSI_CACHE_RESHARD_UNTIL), }, filestore: { url: