remove request.Context from shared channel service methods (#17606)

Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2021-05-11 22:29:30 +03:00
коммит произвёл GitHub
родитель 4d018c2121
Коммит 35bfae9052
10 изменённых файлов: 46 добавлений и 58 удалений

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

@@ -10,7 +10,6 @@ import (
"sync"
"time"
"github.com/mattermost/mattermost-server/v5/app/request"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/services/remotecluster"
"github.com/mattermost/mattermost-server/v5/shared/i18n"
@@ -141,7 +140,6 @@ func stopTimer(timer *time.Timer) {
// doSync checks the task queue for any tasks to be processed and processes all that are ready.
// If any delayed tasks remain in queue then the duration until the next scheduled task is returned.
func (scs *Service) doSync() time.Duration {
c := request.EmptyContext() // TODO: check this
var task syncTask
var ok bool
var shortestWait time.Duration
@@ -151,7 +149,7 @@ func (scs *Service) doSync() time.Duration {
if !ok {
break
}
if err := scs.processTask(c, task); err != nil {
if err := scs.processTask(task); err != nil {
// put task back into map so it will update again
if task.incRetry() {
scs.addTask(task)
@@ -202,7 +200,7 @@ func (scs *Service) removeOldestTask() (syncTask, bool, time.Duration) {
}
// processTask updates one or more remote clusters with any new channel content.
func (scs *Service) processTask(c *request.Context, task syncTask) error {
func (scs *Service) processTask(task syncTask) error {
var err error
var remotes []*model.RemoteCluster