Use request.CTX instead of *request.Context (#24877)

* Use request.CTX instead of *request.Context

* Fix tests
Этот коммит содержится в:
Ben Schumacher
2023-10-30 16:33:37 +01:00
коммит произвёл GitHub
родитель 37dc35c1a1
Коммит c7461751f2
106 изменённых файлов: 612 добавлений и 613 удалений

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

@@ -26,7 +26,7 @@ func MakeMigrationsList() []string {
}
}
func GetMigrationState(c *request.Context, migration string, store store.Store) (string, *model.Job, *model.AppError) {
func GetMigrationState(c request.CTX, migration string, store store.Store) (string, *model.Job, *model.AppError) {
if _, err := store.System().GetByName(migration); err == nil {
return MigrationStateCompleted, nil, nil
}

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

@@ -44,7 +44,7 @@ func (scheduler *Scheduler) NextScheduleTime(cfg *model.Config, now time.Time, p
}
//nolint:unparam
func (scheduler *Scheduler) ScheduleJob(c *request.Context, cfg *model.Config, pendingJobs bool, lastSuccessfulJob *model.Job) (*model.Job, *model.AppError) {
func (scheduler *Scheduler) ScheduleJob(c request.CTX, cfg *model.Config, pendingJobs bool, lastSuccessfulJob *model.Job) (*model.Job, *model.AppError) {
c.Logger().Debug("Scheduling Job", mlog.String("scheduler", model.JobTypeMigrations))
// Work through the list of migrations in order. Schedule the first one that isn't done (assuming it isn't in progress already).
@@ -91,7 +91,7 @@ func (scheduler *Scheduler) ScheduleJob(c *request.Context, cfg *model.Config, p
return nil, nil
}
func (scheduler *Scheduler) createJob(c *request.Context, migrationKey string, lastJob *model.Job) (*model.Job, *model.AppError) {
func (scheduler *Scheduler) createJob(c request.CTX, migrationKey string, lastJob *model.Job) (*model.Job, *model.AppError) {
var lastDone string
if lastJob != nil {
lastDone = lastJob.Data[JobDataKeyMigrationLastDone]