mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-28 01:46:22 +02:00
Add restart on fail
This commit is contained in:
parent
29180216e6
commit
4e09ce75bc
3 changed files with 18 additions and 16 deletions
2
Makefile
2
Makefile
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
# VERSION=$(shell git describe | sed 's/^v//')
|
||||
VERSION=0.3.0
|
||||
VERSION=0.3.1
|
||||
|
||||
all: container
|
||||
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -4,7 +4,7 @@ import os
|
|||
with open("README.md", "r") as fh:
|
||||
long_description = fh.read()
|
||||
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
|
||||
setuptools.setup(
|
||||
name="trustgraph",
|
||||
|
|
|
|||
|
|
@ -57,27 +57,29 @@ class BaseProcessor:
|
|||
@classmethod
|
||||
def start(cls, prog, doc):
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
prog=prog,
|
||||
description=doc
|
||||
)
|
||||
while True:
|
||||
|
||||
cls.add_args(parser)
|
||||
parser = argparse.ArgumentParser(
|
||||
prog=prog,
|
||||
description=doc
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
args = vars(args)
|
||||
cls.add_args(parser)
|
||||
|
||||
try:
|
||||
args = parser.parse_args()
|
||||
args = vars(args)
|
||||
|
||||
p = cls(**args)
|
||||
p.run()
|
||||
try:
|
||||
|
||||
except Exception as e:
|
||||
p = cls(**args)
|
||||
p.run()
|
||||
|
||||
print("Exception:", e, flush=True)
|
||||
print("Will retry...", flush=True)
|
||||
except Exception as e:
|
||||
|
||||
time.sleep(10)
|
||||
print("Exception:", e, flush=True)
|
||||
print("Will retry...", flush=True)
|
||||
|
||||
time.sleep(10)
|
||||
|
||||
class Consumer(BaseProcessor):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue