This is a sort of random checkpoint of work * add schema for tracking messages sent to DB * add terms of service and privacy policy for RCS compliance * standardize some things about background workers * update some missing stuff from generated DB code
23 lines
546 B
Go
23 lines
546 B
Go
package queue
|
|
|
|
import (
|
|
"github.com/google/uuid"
|
|
"github.com/rs/zerolog/log"
|
|
)
|
|
|
|
// AudioJob represents a job to process an audio file.
|
|
type JobAudio struct {
|
|
AudioUUID uuid.UUID
|
|
}
|
|
|
|
var ChannelJobAudio chan JobAudio
|
|
|
|
// EnqueueAudioJob sends an audio processing job to the worker.
|
|
func EnqueueAudioJob(job JobAudio) {
|
|
select {
|
|
case ChannelJobAudio <- job:
|
|
log.Info().Str("uuid", job.AudioUUID.String()).Msg("Enqueued audio job")
|
|
default:
|
|
log.Warn().Str("uuid", job.AudioUUID.String()).Msg("Audio job channel is full, dropping job")
|
|
}
|
|
}
|