Skip to content

Commit

Permalink
Get processor name in delegator from argv
Browse files Browse the repository at this point in the history
  • Loading branch information
joschrew committed Jul 19, 2023
1 parent e866117 commit 10725b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile-slim
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ slim-venv: docker-compose.yaml .env $(DELEGATORS) | $(VIRTUAL_ENV)

# create a delegator to the processing server for the processor
$(BIN)/ocrd-%: | $(VIRTUAL_ENV)
@sed -e "s/{{\s*processor_name\s*}}/$(subst $(BIN)/,,$@)/" -e "s/{{\s*OCRD_PS_PORT\s*}}/$(OCRD_PS_PORT)/" slim-containers-files/delegator_template.py > $@;
@sed -e "s/{{\s*OCRD_PS_PORT\s*}}/$(OCRD_PS_PORT)/" slim-containers-files/delegator_template.py > $@;
@chmod u+x $@


Expand Down
3 changes: 2 additions & 1 deletion slim-containers-files/delegator_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
import sys
import subprocess
from http.server import BaseHTTPRequestHandler, HTTPServer
from os.path import basename

processing_server_address = "http://localhost:{{ OCRD_PS_PORT }}"
processor_name = "{{ processor_name }}"
processor_name = basename(sys.argv[0])

STOP_WAITING_SERVER = False

Expand Down

0 comments on commit 10725b9

Please sign in to comment.