mirror of
https://github.com/ivan-usov-org/bec.git
synced 2025-04-22 02:20:02 +02:00
added missing file_writer files
This commit is contained in:
parent
1f1f07bd93
commit
ed27ea3fff
31
file_writer/launch.py
Normal file
31
file_writer/launch.py
Normal file
@ -0,0 +1,31 @@
|
||||
import argparse
|
||||
import logging
|
||||
import threading
|
||||
|
||||
from bluekafka_utils import RedisConnector, ServiceConfig
|
||||
|
||||
from file_writer import FileWriterManager
|
||||
|
||||
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
||||
parser.add_argument(
|
||||
"--config",
|
||||
default="",
|
||||
help="path to the config file",
|
||||
)
|
||||
clargs = parser.parse_args()
|
||||
config_path = clargs.config
|
||||
|
||||
config = ServiceConfig(config_path)
|
||||
|
||||
logging.basicConfig(filename="scan_bundler.log", level=logging.INFO, filemode="w+")
|
||||
logging.getLogger("kafka").setLevel(50)
|
||||
logging.getLogger().addHandler(logging.StreamHandler())
|
||||
|
||||
sb = FileWriterManager(config.redis, RedisConnector, config.scibec)
|
||||
|
||||
try:
|
||||
event = threading.Event()
|
||||
logging.info("Started FileWriter")
|
||||
event.wait()
|
||||
except KeyboardInterrupt as e:
|
||||
sb.shutdown()
|
6
file_writer/requirements.txt
Normal file
6
file_writer/requirements.txt
Normal file
@ -0,0 +1,6 @@
|
||||
redis
|
||||
msgpack
|
||||
pyyaml
|
||||
typeguard
|
||||
requests
|
||||
h5py
|
Loading…
x
Reference in New Issue
Block a user