Migrate System store to Sync by default (#10838)

Этот коммит содержится в:
Jesús Espino
2019-05-21 18:22:27 +02:00
коммит произвёл GitHub
родитель 3e6fed8df4
Коммит f8a89a52fc
22 изменённых файлов: 310 добавлений и 295 удалений

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

@@ -124,9 +124,9 @@ func TestEnsureInstallationDate(t *testing.T) {
}
if tc.PrevInstallationDate == nil {
<-th.App.Srv.Store.System().PermanentDeleteByName(model.SYSTEM_INSTALLATION_DATE_KEY)
th.App.Srv.Store.System().PermanentDeleteByName(model.SYSTEM_INSTALLATION_DATE_KEY)
} else {
<-th.App.Srv.Store.System().SaveOrUpdate(&model.System{
th.App.Srv.Store.System().SaveOrUpdate(&model.System{
Name: model.SYSTEM_INSTALLATION_DATE_KEY,
Value: strconv.FormatInt(*tc.PrevInstallationDate, 10),
})
@@ -139,9 +139,8 @@ func TestEnsureInstallationDate(t *testing.T) {
} else {
assert.NoError(t, err)
result := <-th.App.Srv.Store.System().GetByName(model.SYSTEM_INSTALLATION_DATE_KEY)
assert.Nil(t, result.Err)
data, _ := result.Data.(*model.System)
data, err := th.App.Srv.Store.System().GetByName(model.SYSTEM_INSTALLATION_DATE_KEY)
assert.Nil(t, err)
value, _ := strconv.ParseInt(data.Value, 10, 64)
assert.True(t, *tc.ExpectedInstallationDate <= value && *tc.ExpectedInstallationDate+1000 >= value)
}