mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-27 17:36:23 +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=$(shell git describe | sed 's/^v//')
|
||||||
VERSION=0.3.0
|
VERSION=0.3.1
|
||||||
|
|
||||||
all: container
|
all: container
|
||||||
|
|
||||||
|
|
|
||||||
2
setup.py
2
setup.py
|
|
@ -4,7 +4,7 @@ import os
|
||||||
with open("README.md", "r") as fh:
|
with open("README.md", "r") as fh:
|
||||||
long_description = fh.read()
|
long_description = fh.read()
|
||||||
|
|
||||||
version = "0.3.0"
|
version = "0.3.1"
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="trustgraph",
|
name="trustgraph",
|
||||||
|
|
|
||||||
|
|
@ -57,27 +57,29 @@ class BaseProcessor:
|
||||||
@classmethod
|
@classmethod
|
||||||
def start(cls, prog, doc):
|
def start(cls, prog, doc):
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(
|
while True:
|
||||||
prog=prog,
|
|
||||||
description=doc
|
|
||||||
)
|
|
||||||
|
|
||||||
cls.add_args(parser)
|
parser = argparse.ArgumentParser(
|
||||||
|
prog=prog,
|
||||||
|
description=doc
|
||||||
|
)
|
||||||
|
|
||||||
args = parser.parse_args()
|
cls.add_args(parser)
|
||||||
args = vars(args)
|
|
||||||
|
|
||||||
try:
|
args = parser.parse_args()
|
||||||
|
args = vars(args)
|
||||||
|
|
||||||
p = cls(**args)
|
try:
|
||||||
p.run()
|
|
||||||
|
|
||||||
except Exception as e:
|
p = cls(**args)
|
||||||
|
p.run()
|
||||||
|
|
||||||
print("Exception:", e, flush=True)
|
except Exception as e:
|
||||||
print("Will retry...", flush=True)
|
|
||||||
|
|
||||||
time.sleep(10)
|
print("Exception:", e, flush=True)
|
||||||
|
print("Will retry...", flush=True)
|
||||||
|
|
||||||
|
time.sleep(10)
|
||||||
|
|
||||||
class Consumer(BaseProcessor):
|
class Consumer(BaseProcessor):
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue