diff --git a/Tiltfile b/Tiltfile index 68f5b72..3a98416 100644 --- a/Tiltfile +++ b/Tiltfile @@ -18,6 +18,10 @@ k8s_yaml(configmap_from_dict("mev-inspect-rpc", inputs = { "url" : os.environ["RPC_URL"], })) +k8s_yaml(configmap_from_dict("mev-inspect-rpc-list, inputs = { + "list" : os.environ["RPC_URL"], +})) + k8s_yaml(configmap_from_dict("mev-inspect-listener-healthcheck", inputs = { "url" : os.getenv("LISTENER_HEALTHCHECK_URL", default=""), })) diff --git a/k8s/mev-inspect-workers/templates/deployment.yaml b/k8s/mev-inspect-workers/templates/deployment.yaml index 0a3238f..de961bf 100644 --- a/k8s/mev-inspect-workers/templates/deployment.yaml +++ b/k8s/mev-inspect-workers/templates/deployment.yaml @@ -85,6 +85,11 @@ spec: configMapKeyRef: name: mev-inspect-rpc key: url + - name: RPC_LIST + valueFrom: + configMapKeyRef: + name: mev-inspect-rpc-list + key: list - name: LISTENER_HEALTHCHECK_URL valueFrom: configMapKeyRef: @@ -118,7 +123,7 @@ spec: {{- range .Values.extraEnv }} - name: {{ .name }} value: {{ .value }} - {{- end }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/listener.py b/listener.py index e547bc0..c38e4ce 100644 --- a/listener.py +++ b/listener.py @@ -3,7 +3,6 @@ import logging import os import dramatiq -from aiohttp.client_exceptions import ClientOSError from aiohttp_retry import ExponentialRetry, RetryClient from mev_inspect.block import get_latest_block_number @@ -129,7 +128,8 @@ async def ping_healthcheck_url(url): if __name__ == "__main__": try: run() - except ClientOSError or ConnectionRefusedError: - if rpc_list is not None: + except Exception as e: + logger.error(e) + if rpc_list is not None and CURRENT_RPC < len(rpc_list): rpc = rpc_list[CURRENT_RPC + 1] run()