Commit dd13f70b authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Device component:

- Moved pre-load of drivers after start of gRPC server. Otherwise, K8s kills the component when retrieval of devices takes long time.
parent 69a6a4af
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -58,13 +58,14 @@ def main():
    driver_factory = DriverFactory(DRIVERS)
    driver_instance_cache = DriverInstanceCache(driver_factory)

    # Initialize drivers with existing devices in context
    preload_drivers(driver_instance_cache)

    # Starting device service
    grpc_service = DeviceService(driver_instance_cache)
    grpc_service.start()

    # Initialize drivers with existing devices in context
    LOGGER.info('Pre-loading drivers...')
    preload_drivers(driver_instance_cache)

    # Wait for Ctrl+C or termination signal
    while not terminate.wait(timeout=1.0): pass