Skip to content

Commit be22bcd

Browse files
authored
index: inline tenant.SrcPrefix (#955)
It had exactly one call site and the logic was super simple. So I think it is clearer to just inline the logic here. Test Plan: mechanical refactor so just CI. In a future PR I will be adding better test coverage just on this function.
1 parent 31ddc11 commit be22bcd

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

index/builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ func (o *Options) shardNameVersion(version, n int) string {
338338

339339
// If tenant enforcement is enabled and we have tenant/repo IDs, use those to generate the prefix
340340
if o.RepositoryDescription.TenantID != 0 && o.RepositoryDescription.ID != 0 && tenant.EnforceTenant() {
341-
prefix = tenant.SrcPrefix(o.RepositoryDescription.TenantID, o.RepositoryDescription.ID)
341+
prefix = fmt.Sprintf("%09d_%09d", o.RepositoryDescription.TenantID, o.RepositoryDescription.ID)
342342
} else {
343343
prefix = o.RepositoryDescription.Name
344344
}

internal/tenant/shards.go

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)