Skip to content

Commit

Permalink
fix: take workpaceid from config backend key (#2683)
Browse files Browse the repository at this point in the history
  • Loading branch information
BonapartePC authored and atzoum committed Nov 11, 2022
1 parent 5fa3f26 commit 129fb2e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions services/fileuploader/fileuploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,23 +87,23 @@ func (p *provider) updateLoop(ctx context.Context, backendConfig backendconfig.B

for ev := range ch {
configs := ev.Data.(map[string]backendconfig.ConfigT)
for _, c := range configs {
for workspaceId, c := range configs {

var bucket backendconfig.StorageBucket
var preferences backendconfig.StoragePreferences

if c.Settings.DataRetention.UseSelfStorage {
settings := c.Settings.DataRetention.StorageBucket
defaultBucket := getDefaultBucket(ctx, settings.Type)
bucket = overrideWithSettings(defaultBucket.Config, settings, c.WorkspaceID)
bucket = overrideWithSettings(defaultBucket.Config, settings, workspaceId)
} else {
bucket = getDefaultBucket(ctx, config.GetString("JOBS_BACKUP_STORAGE_PROVIDER", "S3"))
}
// bucket type and configuration must not be empty
if bucket.Type != "" && len(bucket.Config) > 0 {
preferences = c.Settings.DataRetention.StoragePreferences
}
settings[c.WorkspaceID] = StorageSettings{
settings[workspaceId] = StorageSettings{
Bucket: bucket,
Preferences: preferences,
}
Expand Down

0 comments on commit 129fb2e

Please sign in to comment.