[MM-57500] Streaming support for importing file attachments (#26629)

* Bulk import: stream file attachments uploads

* Add comment with context on buffer size

* Add file name to logs

* Use sha256 to do checksum

* Fix bad merge

* Fix import file

* Update test

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Claudio Costa
2024-04-19 15:49:33 -06:00
коммит произвёл GitHub
родитель ffc08858cf
Коммит 446c763fa8
10 изменённых файлов: 542 добавлений и 74 удалений

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

@@ -267,12 +267,16 @@ func TestImportProcessImportDataFileVersionLine(t *testing.T) {
}
func GetAttachments(userID string, th *TestHelper, t *testing.T) []*model.FileInfo {
t.Helper()
fileInfos, err := th.App.Srv().Store().FileInfo().GetForUser(userID)
require.NoError(t, err)
return fileInfos
}
func AssertFileIdsInPost(files []*model.FileInfo, th *TestHelper, t *testing.T) {
t.Helper()
postID := files[0].PostId
require.NotNil(t, postID)