mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-30 10:56: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
|
|
@ -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