fix(worker): lab7 stop image processing at the job deadline
This commit is contained in:
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"log"
|
||||
"log/slog"
|
||||
"os"
|
||||
@@ -26,6 +27,16 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
if len(os.Args) == 3 && os.Args[1] == "render" {
|
||||
if err := worker.Render(os.Args[2], os.Stdin, os.Stdout); err != nil {
|
||||
if errors.Is(err, worker.ErrInvalidImage) {
|
||||
os.Exit(65)
|
||||
}
|
||||
os.Exit(1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
cfg, err := config.Load()
|
||||
if err != nil {
|
||||
log.Fatalf("конфигурация: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user