Skip to content

Commit

Permalink
added 5 minute timoute on ocr reader
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirari04 committed Jan 22, 2024
1 parent aa6add1 commit 7cf5feb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions services/Encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"ch/kirari04/videocms/helpers"
"ch/kirari04/videocms/inits"
"ch/kirari04/videocms/models"
"context"
"crypto/sha256"
"fmt"
"log"
Expand Down Expand Up @@ -712,8 +713,12 @@ func prepocessPgs(encodingTask models.Subtitle, absFolderOutput string, absFileI
return fmt.Errorf("Error happend while opening pgs subtitle: %v", err.Error())
}

ctx, cancel := context.WithTimeout(context.Background(), time.Minute*5)
defer cancel()

client := req.C()
res, err := client.R().
SetContext(ctx).
SetFileReader("file", "subtitle.sup", pgsFile).
Post(config.ENV.PluginPgsServer)
if err != nil {
Expand Down

0 comments on commit 7cf5feb

Please sign in to comment.