Skip to content

Commit 156b8e4

Browse files
committed
Fixed loffice process start bug.
1 parent 057b298 commit 156b8e4

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@
7272
LIBRE_OFFICE_PORT_CAP = DEFAULT_LIBRE_OFFICE_SERVER_PORT + 1
7373

7474
if OCR_WEB_SERVICE_THREADS > 1:
75-
LIBRE_OFFICE_PORT_CAP += OCR_WEB_SERVICE_THREADS
75+
LIBRE_OFFICE_PORT_CAP = DEFAULT_LIBRE_OFFICE_SERVER_PORT + OCR_WEB_SERVICE_THREADS
7676
if OCR_WEB_SERVICE_WORKERS > 1:
77-
LIBRE_OFFICE_PORT_CAP += OCR_WEB_SERVICE_WORKERS
77+
LIBRE_OFFICE_PORT_CAP = DEFAULT_LIBRE_OFFICE_SERVER_PORT + OCR_WEB_SERVICE_WORKERS
7878

7979
LIBRE_OFFICE_LISTENER_PORT_RANGE = range(DEFAULT_LIBRE_OFFICE_SERVER_PORT, LIBRE_OFFICE_PORT_CAP)
8080
LIBRE_OFFICE_NETWORK_INTERFACE = "localhost"

ocr_service/app/app.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,10 @@ def start_office_converter_servers():
4949
port_count = 0
5050
for port_num in LIBRE_OFFICE_LISTENER_PORT_RANGE:
5151
if OCR_WEB_SERVICE_WORKERS > 1:
52-
if port_count < 1:
53-
if port_num not in list(loffice_processes.keys()):
54-
port_count += 1
55-
if is_port_in_use(port_num) == False:
56-
loffice_processes[port_num] = start_office_server(port_num)
52+
if port_num not in list(loffice_processes.keys()):
53+
port_count += 1
54+
if is_port_in_use(port_num) == False:
55+
loffice_processes[port_num] = start_office_server(port_num)
5756
else:
5857
break
5958
else:

0 commit comments

Comments
 (0)