Reducing the filestore dependencies from the rest of the source code (#16816)

* Reducing the filestore dependencies from the rest of the source code

* Making more generic config conversion to FileBackendSettings

* Fixing usage of the NewFileBackend function

* Fixing more usages of the NewFileBackend function

* Fix some linter errors

* Fix more linter errors

* Fixing some unit tests

* Fixing linter problem

* Addressing PR review comments

* Simplifing the CopyFile for tests

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Jesús Espino
2021-02-15 10:09:28 +01:00
коммит произвёл GitHub
родитель a246104d04
Коммит a3de71fba4
15 изменённых файлов: 231 добавлений и 144 удалений

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

@@ -1568,7 +1568,7 @@ func (s *Server) stopSearchEngine() {
func (s *Server) FileBackend() (filesstore.FileBackend, *model.AppError) {
license := s.License()
backend, err := filesstore.NewFileBackend(&s.Config().FileSettings, license != nil && *license.Features.Compliance)
backend, err := filesstore.NewFileBackend(s.Config().FileSettings.ToFileBackendSettings(license != nil && *license.Features.Compliance))
if err != nil {
return nil, model.NewAppError("FileBackend", "api.file.no_driver.app_error", nil, err.Error(), http.StatusInternalServerError)
}