Skip to content

Commit

Permalink
chore: refactor 4
Browse files Browse the repository at this point in the history
  • Loading branch information
cisse21 committed Dec 11, 2024
1 parent 1161fbb commit 420a53e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion warehouse/router/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,11 @@ func (job *UploadJob) run() (err error) {
return err
}
defer whManager.Cleanup(job.ctx)

_, err = job.schemaHandle.GetLocalSchema(job.ctx)
if err != nil {
_, _ = job.setUploadError(err, InternalProcessingFailed)
return err
}
var (
newStatus string
nextUploadState *state
Expand Down
3 changes: 3 additions & 0 deletions warehouse/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@ func (sh *Schema) GetLocalSchema(ctx context.Context) (model.Schema, error) {
if whSchema.Schema == nil {
return model.Schema{}, nil
}
sh.localSchemaMu.Lock()
sh.localSchema = whSchema.Schema
sh.localSchemaMu.Unlock()
return whSchema.Schema, nil
}

Expand Down

0 comments on commit 420a53e

Please sign in to comment.