From 3ca1defc885d9d377305f37e55a5d92cd916dd4f Mon Sep 17 00:00:00 2001 From: cybermaggedon Date: Sun, 25 Aug 2024 20:45:04 +0100 Subject: [PATCH] Increase timeout (#36) * Increase timeout * Bump version --- Makefile | 2 +- setup.py | 2 +- trustgraph/clients/base.py | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 54e0ecfd..00067784 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # VERSION=$(shell git describe | sed 's/^v//') -VERSION=0.7.11 +VERSION=0.7.12 DOCKER=podman diff --git a/setup.py b/setup.py index 5e5906db..389f8d13 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import os with open("README.md", "r") as fh: long_description = fh.read() -version = "0.7.11" +version = "0.7.12" setuptools.setup( name="trustgraph", diff --git a/trustgraph/clients/base.py b/trustgraph/clients/base.py index fa1d5cbc..e574a47d 100644 --- a/trustgraph/clients/base.py +++ b/trustgraph/clients/base.py @@ -8,6 +8,9 @@ from pulsar.schema import JsonSchema from .. exceptions import * +# Default timeout for a request/response. In seconds. +DEFAULT_TIMEOUT=300 + # Ugly ERROR=_pulsar.LoggerLevel.Error WARN=_pulsar.LoggerLevel.Warn @@ -55,7 +58,7 @@ class BaseClient: def call(self, **args): - timeout = args.get("timeout", 30) + timeout = args.get("timeout", DEFAULT_TIMEOUT) if "timeout" in args: del args["timeout"] @@ -112,7 +115,6 @@ class BaseClient: def __del__(self): if hasattr(self, "consumer"): -# self.consumer.unsubscribe() self.consumer.close() if hasattr(self, "producer"):