MM-54158: S3PathMigration: Re-initialize stop chan (#24286)

This got missed out in the initial PR review.

There's been only one instance of this, and that too in a spinwick
so it's not widepsread. We will cp this if we see more crashes.

https://mattermost.atlassian.net/browse/MM-54158

```release-note
NONE
```
This commit is contained in:
Agniva De Sarker 2023-08-17 19:49:40 +05:30 committed by GitHub
parent b814d76488
commit 7db5b473bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,6 +52,9 @@ func MakeWorker(jobServer *jobs.JobServer, store store.Store, fileBackend filest
func (worker *S3PathMigrationWorker) Run() {
mlog.Debug("Worker started", mlog.String("worker", worker.name))
// We have to re-assign the stop channel again, because
// it might happen that the job was restarted due to a config change.
worker.stop = make(chan bool, 1)
defer func() {
mlog.Debug("Worker finished", mlog.String("worker", worker.name))