GH-10761: Migrate Post.Get to sync by default (#10831)

* GH-10761: Migrate Post.Get to sync by default

* instantiate storeChannel with make

* fix go vet issue

* fix go vet issue

* use select for checking channel for value

* fix go vet shadow variable issue

* addressing review comments

* call post.Get() in goroutine

* refactor minor values to fix tests

* fix: remove err error type, it should be *model.AppErr
Этот коммит содержится в:
PR
2019-05-21 11:01:30 -07:00
коммит произвёл Christopher Speller
родитель 8c048a6604
Коммит 0b6acaa9ba
7 изменённых файлов: 272 добавлений и 156 удалений

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

@@ -83,19 +83,28 @@ func (_m *PostStore) Delete(postId string, time int64, deleteByID string) *model
}
// Get provides a mock function with given fields: id
func (_m *PostStore) Get(id string) store.StoreChannel {
func (_m *PostStore) Get(id string) (*model.PostList, *model.AppError) {
ret := _m.Called(id)
var r0 store.StoreChannel
if rf, ok := ret.Get(0).(func(string) store.StoreChannel); ok {
var r0 *model.PostList
if rf, ok := ret.Get(0).(func(string) *model.PostList); ok {
r0 = rf(id)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(store.StoreChannel)
r0 = ret.Get(0).(*model.PostList)
}
}
return r0
var r1 *model.AppError
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
r1 = rf(id)
} else {
if ret.Get(1) != nil {
r1 = ret.Get(1).(*model.AppError)
}
}
return r0, r1
}
// GetDirectPostParentsForExportAfter provides a mock function with given fields: limit, afterId