Add job helpers
This commit is contained in:
@@ -40,3 +40,14 @@ func (j *TranscribeJob) MoveToStateAndDelay(state string, delay *time.Time) {
|
||||
j.DelayTime = delay
|
||||
j.UpdatedAt = time.Now()
|
||||
}
|
||||
|
||||
func (j *TranscribeJob) Done(transcriptionText string) {
|
||||
j.MoveToState(StateDone)
|
||||
j.TranscriptionText = &transcriptionText
|
||||
}
|
||||
|
||||
func (j *TranscribeJob) Fail(errText string) {
|
||||
j.MoveToState(StateFailed)
|
||||
j.IsError = true
|
||||
j.ErrorText = &errText
|
||||
}
|
||||
|
Reference in New Issue
Block a user