Commit f7e3feee authored by Ajil K's avatar Ajil K

fix: restart issue on primary

parent 903e9233
logger:
level: TRACE
level: DEBUG
handlers:
- back_up_count: 5
file_path: logs/
logg_mqtt: true
max_bytes: 100000000
type: RotatingFileHandler
- type: StreamHandler
# - type: StreamHandler
primary_device:
resync_time: "00:15"
......@@ -14,7 +14,7 @@ primary_device:
files_to_watch: C:\\iLens\\ilens-agent\\engine\\acquisition_engine\\conf,C:\\iLens\\ilens-agent\\conf
secondary_device:
host_ip: 192.168.2.0
host_ip: secondary_device_ip
port: 8088
data_check_frequency: 5
......@@ -22,28 +22,28 @@ quality_time_frequency: 2
acquisition_restart_frequency: 2
local_uploader:
type: mqtt
host_ip: 192.168.0.220
port: 31767
username: admin
password: FtAdm#MqTt71513
type: udp
host_ip: 127.0.0.1
port: 20015
# username: admin
# password: FtAdm#MqTt71513
event_uploader:
type: http
host_ip: http://dev.unifytwin.com
host_ip: https://dev.unifytwin.com
# port: 20004
start_delay_time: 0
data_source: True
data_source: False
config:
channel:
uploader_host: 192.168.3.145
uploader_port: 502
agent:
base_url: http://dev.unifytwin.com/dcp_api
base_url: https://dev.unifytwin.com/dcp_api
monitoring_engine:
# host_ip:
# port:
url: http://dev.unifytwin.com
\ No newline at end of file
url: https://dev.unifytwin.com
\ No newline at end of file
......@@ -15,8 +15,8 @@ class AppConfig:
event_uploader_port = config_data.get("event_uploader", {}).get("port", None)
start_delay_time = int(config_data.get("start_delay_time", 0))
resync_time = config_data.get("primary_device", {}).get("resync_time", "")
run_time = int(config_data.get("primary_device", {}).get("heartbeat_interval", ""))
resync_time = config_data.get("primary_device", {}).get("resync_time", "00:15")
run_time = int(config_data.get("primary_device", {}).get("heartbeat_interval", 120))
files_to_watch = config_data.get("primary_device", {}).get("files_to_watch", "")
host_ip = config_data.get("secondary_device", {}).get("host_ip", "")
......
......@@ -19,7 +19,7 @@ class EventConstants:
configuration_modification = "IR-PI003"
pipeline_mismatch = "IR-PI004"
primary_acq_stopped = "IR-PI005"
primary_acq_restarted = "IR-PI006"
configuration_sync = "IR-SI001"
pipeline_updated = "IR-SI002"
configuration_updated = "IR-SI003"
......@@ -74,6 +74,13 @@ class EventConstants:
"event_description": "Acquisition engine is stopped on primary device.",
"level": "Information",
},
"IR-PI006": {
"event_code": "IR-PI006",
"event_category": "Acquisition Engine",
"event_type": "Restarted Acquisition Engine",
"event_description": "Acquisition engine got restarted on primary device.",
"level": "Information",
},
"IR-SI001": {
"event_code": "IR-SI001",
"event_category": "Daily Sync",
......
......@@ -211,10 +211,6 @@ def redundancy_initializer(logger_obj):
redundancy_handler = RedundancyHandler(logger_obj)
if app_config.is_data_source:
client_status = service_operations.check_ilens_client_status(logger_obj)
if not client_status:
if service_operations.restart_service(services.acquisition_engine, logger_obj):
logger_obj.info("Acquisition Engine started on primary redundancy module.")
if app_config.local_uploader_type.lower() == "mqtt":
logger_obj.info("Using local MQTT Subscriber.")
local_mqtt_thread = threading.Thread(
......@@ -243,6 +239,13 @@ def redundancy_initializer(logger_obj):
try:
while True:
if app_config.is_data_source:
client_status = service_operations.check_ilens_client_status(logger_obj)
if not client_status:
if service_operations.restart_service(services.acquisition_engine, logger_obj):
logger_obj.info("Acquisition Engine started on primary redundancy module.")
post_events(event_code=events_constants.primary_acq_restarted,
module_name="Acquisition Engine", logger=logger_obj)
schedule.run_pending()
post_data(redundancy_handler.fetch_device_details(), logger_obj, endpoint="fetch_device_details")
time.sleep(app_config.run_time)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment