[MM-48946] Fix read after write issue when uploading data (#21868)
* Fix read after write issue when uploading data * Prefer request.CTX interface
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
68373e992b
Коммит
6fd174a95f
@@ -1255,7 +1255,9 @@ func (api *PluginAPI) UploadData(us *model.UploadSession, rd io.Reader) (*model.
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetUploadSession(uploadID string) (*model.UploadSession, error) {
|
||||
fi, err := api.app.GetUploadSession(uploadID)
|
||||
// We want to fetch from master DB to avoid a potential read-after-write on the plugin side.
|
||||
api.ctx.SetContext(WithMaster(api.ctx.Context()))
|
||||
fi, err := api.app.GetUploadSession(api.ctx, uploadID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user