Skip to content

Commit 4c2b6b2

Browse files
committed
fix: proper use of the auto allocated port for base inference api
1 parent 8a7c96a commit 4c2b6b2

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

extensions/business/edge_inference_api/base_inference_api.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,15 @@ def _get_payload_field(self, data: dict, key: str, default=None):
185185
return default
186186

187187
def _setup_semaphore_env(self):
188-
"""Set semaphore environment variables for bundled plugins."""
188+
"""
189+
Set semaphore environment variables for bundled plugins.
190+
This method is called by _semaphore_maybe_auto_signal(),
191+
which is called by the process_wrapper() method, thus
192+
it's executed after the on_init() method => self.port will
193+
already be allocated automatically if not already explicit.
194+
"""
189195
localhost_ip = self.log.get_localhost_ip()
190-
port = self.cfg_port
196+
port = self.port
191197
self.semaphore_set_env('API_HOST', localhost_ip)
192198
if port:
193199
self.semaphore_set_env('API_PORT', str(port))

plugins/business/cerviguard/local_serving_api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""
2+
THIS PLUGIN IS OBSOLETE - REPLACED BY CERVIGUARD_API
23
LOCAL_SERVING_API Plugin
34
45
This plugin creates a FastAPI server for local-only access (localhost) that works with
@@ -126,6 +127,7 @@ def on_init(self):
126127
self.__requests = {} # Track active requests (PostponedRequest pattern)
127128
self._data_buffer = [] # Simple activity log for monitoring
128129

130+
self.P(f"WARNING!!! THIS PLUGIN IS OBSOLETE - REPLACED BY CERVIGUARD_API", color='r', boxed=True)
129131
self.P("Local Serving API initialized - Loopback + PostponedRequest mode", color='g')
130132
self.P(f" Endpoints: /predict, /list_results, /status, /health", color='g')
131133
self.P(f" AI Engine: {self.cfg_ai_engine}", color='g')

ver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__VER__ = '2.10.35'
1+
__VER__ = '2.10.36'

0 commit comments

Comments
 (0)