MM-38698: Add limit to the CLI compliance export command (#20997)
```release-note A batchSize option has been added to the mattermost export CLI command to limit the number of items exported. By default, if it is not included, it exports all the posts. ``` https://mattermost.atlassian.net/browse/MM-38698 Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
4f363574fc
Коммит
a8154ddae0
@@ -175,6 +175,11 @@ func testComplianceExport(t *testing.T, ss store.Store) {
|
||||
assert.Equal(t, cposts[0].PostId, o1.Id)
|
||||
assert.Equal(t, cposts[3].PostId, o2a.Id)
|
||||
|
||||
// Test limit
|
||||
cposts, _, nErr = ss.Compliance().ComplianceExport(cr1, model.ComplianceExportCursor{}, 2)
|
||||
require.NoError(t, nErr)
|
||||
assert.Len(t, cposts, 2)
|
||||
|
||||
cr2 := &model.Compliance{Desc: "test" + model.NewId(), StartAt: o1.CreateAt - 1, EndAt: o2a.CreateAt + 1, Emails: u2.Email}
|
||||
cposts, _, nErr = ss.Compliance().ComplianceExport(cr2, model.ComplianceExportCursor{}, limit)
|
||||
require.NoError(t, nErr)
|
||||
|
||||
Ссылка в новой задаче
Block a user