Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
test
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ajil.k
test
Commits
f7e3feee
Commit
f7e3feee
authored
Jan 30, 2025
by
Ajil K
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: restart issue on primary
parent
903e9233
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
19 deletions
+29
-19
conf/config.yml
conf/config.yml
+12
-12
scripts/constants/app_config.py
scripts/constants/app_config.py
+2
-2
scripts/constants/events.py
scripts/constants/events.py
+8
-1
scripts/core/handlers/files_handler.py
scripts/core/handlers/files_handler.py
+7
-4
No files found.
conf/config.yml
View file @
f7e3feee
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
:
1
92.168.0.220
port
:
31767
username
:
admin
password
:
FtAdm#MqTt71513
type
:
udp
host_ip
:
1
27.0.0.1
port
:
20015
#
username: admin
#
password: FtAdm#MqTt71513
event_uploader
:
type
:
http
host_ip
:
http://dev.unifytwin.com
host_ip
:
http
s
://dev.unifytwin.com
# port: 20004
start_delay_time
:
0
data_source
:
Tru
e
data_source
:
Fals
e
config
:
channel
:
uploader_host
:
192.168.3.145
uploader_port
:
502
agent
:
base_url
:
http://dev.unifytwin.com/dcp_api
base_url
:
http
s
://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
scripts/constants/app_config.py
View file @
f7e3feee
...
...
@@ -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"
,
""
)
...
...
scripts/constants/events.py
View file @
f7e3feee
...
...
@@ -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"
,
...
...
scripts/core/handlers/files_handler.py
View file @
f7e3feee
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment