import logging
import os
import signal
+import sys
import time
from bunch import Bunch
level=logging.getLevelName(args.log_lvl),
datefmt='%m/%d/%Y %H:%M:%S')
+status = 0
+
with open(args.config_file) as f:
cfg = json.load(f)
+bunch_idx = 1
bunches = []
for bunch_cfg in cfg['bunches']:
- bunches.append( Bunch(bunch_cfg) )
-
+ bunches.append( Bunch(bunch_idx, cfg['cache_dir'], bunch_cfg) )
+ bunch_idx += 1
for bunch in bunches:
bunch.start()
for bunch in bunches:
if not bunch.is_running():
stop = True
+ status = 1
time.sleep(2.0)
for bunch in bunches:
bunch.stop()
+
+sys.exit(status)