Add worker process for CSV import jobs
This commit is contained in:
parent
f81f8def1c
commit
d17c8b8be7
2 changed files with 48 additions and 3 deletions
|
|
@ -13,9 +13,10 @@ var waitGroup sync.WaitGroup
|
|||
func Start(ctx context.Context) {
|
||||
newOAuthTokenChannel = make(chan struct{}, 10)
|
||||
|
||||
channelJobAudio = make(chan jobAudio, 100) // Buffered channel to prevent blocking
|
||||
channelJobEmail = make(chan email.Job, 100) // Buffered channel to prevent blocking
|
||||
channelJobText = make(chan text.Job, 100) // Buffered channel to prevent blocking
|
||||
channelJobAudio = make(chan jobAudio, 100) // Buffered channel to prevent blocking
|
||||
channelJobImportCSVPool = make(chan jobImportCSVPool, 100) // Buffered channel to prevent blocking
|
||||
channelJobEmail = make(chan email.Job, 100) // Buffered channel to prevent blocking
|
||||
channelJobText = make(chan text.Job, 100) // Buffered channel to prevent blocking
|
||||
|
||||
waitGroup.Add(1)
|
||||
go func() {
|
||||
|
|
@ -29,6 +30,12 @@ func Start(ctx context.Context) {
|
|||
startWorkerAudio(ctx, channelJobAudio)
|
||||
}()
|
||||
|
||||
waitGroup.Add(1)
|
||||
go func() {
|
||||
defer waitGroup.Done()
|
||||
startWorkerCSV(ctx, channelJobImportCSVPool)
|
||||
}()
|
||||
|
||||
waitGroup.Add(1)
|
||||
go func() {
|
||||
defer waitGroup.Done()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue