fix(worker): lab7 stop image processing at the job deadline

This commit is contained in:
Голиков Maximillian Антон
2026-11-29 16:34:52 +03:00
parent ea09e3b642
commit c04985a60d
4 changed files with 131 additions and 28 deletions
+11
View File
@@ -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)