Simplify workers and fix metrics
This commit is contained in:
@@ -118,7 +118,7 @@ func (s *TranscribeService) FindAndRunConversionJob() error {
|
||||
job, err := s.jobRepo.FindAndAcquire(entity.StateCreated, acquisitionId, rottingTime)
|
||||
if err != nil {
|
||||
if _, ok := err.(*contract.JobNotFoundError); ok {
|
||||
return nil
|
||||
return &contract.NoopJobError{State: entity.StateCreated}
|
||||
}
|
||||
return err
|
||||
}
|
||||
@@ -194,7 +194,7 @@ func (s *TranscribeService) FindAndRunTranscribeJob() error {
|
||||
jobRecord, err := s.jobRepo.FindAndAcquire(entity.StateConverted, acquisitionId, rottingTime)
|
||||
if err != nil {
|
||||
if _, ok := err.(*contract.JobNotFoundError); ok {
|
||||
return nil
|
||||
return &contract.NoopJobError{State: entity.StateConverted}
|
||||
}
|
||||
return err
|
||||
}
|
||||
@@ -247,7 +247,7 @@ func (s *TranscribeService) FindAndRunTranscribeCheckJob() error {
|
||||
job, err := s.jobRepo.FindAndAcquire(entity.StateTranscribe, acquisitionId, rottingTime)
|
||||
if err != nil {
|
||||
if _, ok := err.(*contract.JobNotFoundError); ok {
|
||||
return nil
|
||||
return &contract.NoopJobError{State: entity.StateTranscribe}
|
||||
}
|
||||
return fmt.Errorf("failed find and acquire job: %s, %w", entity.StateTranscribe, err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user