Fix exception and add configmaps

This commit is contained in:
Gui Heise 2022-05-02 17:09:20 -04:00
parent 308902e62c
commit 813e2034d4
3 changed files with 13 additions and 4 deletions

View File

@ -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=""),
}))

View File

@ -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 }}

View File

@ -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()