diff --git a/cloudvision/cvlib/context.py b/cloudvision/cvlib/context.py index 5686be4..1e1ab4a 100644 --- a/cloudvision/cvlib/context.py +++ b/cloudvision/cvlib/context.py @@ -126,6 +126,16 @@ def __init__(self, user: User, self.studioCustomData = StudioCustomData(self) self.workspace: Optional[Workspace] = None + def cleanup(self): + ''' + Cleans up open channels and other connections + Called by the script execution infra once a script or template has been executed + ''' + if self.__connector: + self.__connector.close() + if self.__serviceChann: + self.__serviceChann.close() + def getDevice(self): ''' Returns the device associated to the context.