Add the content field to FileInfo (#15749)

* Add the content field to FileInfo

* Fixing the upgrade code

* Trying to fix the text-scheme

* Fixing test-schema

* Fixing test-schema

* Moving the migration to the next version
Этот коммит содержится в:
Jesús Espino
2020-11-02 15:43:48 +01:00
коммит произвёл GitHub
родитель 9bff309dd0
Коммит 24621a22ed
8 изменённых файлов: 111 добавлений и 2 удалений

Просмотреть файл

@@ -3336,6 +3336,26 @@ func (s *RetryLayerFileInfoStore) Save(info *model.FileInfo) (*model.FileInfo, e
}
func (s *RetryLayerFileInfoStore) SetContent(fileId string, content string) error {
tries := 0
for {
err := s.FileInfoStore.SetContent(fileId, content)
if err == nil {
return nil
}
if !isRepeatableError(err) {
return err
}
tries++
if tries >= 3 {
err = errors.Wrap(err, "giving up after 3 consecutive repeatable transaction failures")
return err
}
}
}
func (s *RetryLayerFileInfoStore) Upsert(info *model.FileInfo) (*model.FileInfo, error) {
tries := 0