Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
redis_producer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mohammed.shibili
redis_producer
Commits
afe42478
Commit
afe42478
authored
Feb 06, 2023
by
mohammed.shibili
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
corrections done
parent
beced782
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
2 deletions
+29
-2
.idea/sonarlint/issuestore/index.pb
+5
-0
script/core/handlers/mqtt_coo.py
+2
-0
script/core/handlers/patient_info.py
+0
-2
script/core/handlers/redis_connection.py
+2
-0
script/logging/exceptions.log
+0
-0
script/logging/loggers.py
+20
-0
No files found.
.idea/sonarlint/issuestore/index.pb
View file @
afe42478
No preview for this file type
script/core/handlers/mqtt_coo.py
View file @
afe42478
from
paho.mqtt
import
client
as
mqtt
from
script.config.appconf
import
mqtt_broker
,
mqtt_port
,
mqtt_time
from
script.logging.loggers
import
logger
def
mqtt_conn
():
...
...
@@ -10,4 +11,5 @@ def mqtt_conn():
print
(
"mqtt connected"
)
return
mqtt_
except
Exception
as
e
:
logger
.
exception
(
e
)
print
(
"mqtt fail"
,
e
)
script/core/handlers/patient_info.py
View file @
afe42478
...
...
@@ -31,8 +31,6 @@ class Consultancy:
# decoding keys in redis
decoded_keys
=
[
values
.
decode
()
for
values
in
keys
]
topic
=
''
# print(Consultancy().doctors_list)
# print(Consultancy.self.current_doctor)
# checking whether patient is consulted before
for
patient_id
in
decoded_keys
:
# if patient is consulted before assign him to previous doctor
...
...
script/core/handlers/redis_connection.py
View file @
afe42478
import
redis
from
script.config.appconf
import
redis_host
,
redis_port
from
script.logging.loggers
import
logger
def
redis_connection
():
...
...
@@ -11,4 +12,5 @@ def redis_connection():
return
redis_conn
except
Exception
as
e
:
logger
.
exception
(
e
)
print
(
"redis connection fail"
,
e
)
script/logging/exceptions.log
0 → 100644
View file @
afe42478
script/logging/loggers.py
0 → 100644
View file @
afe42478
import
logging
import
os
from
logging.handlers
import
RotatingFileHandler
def
get_logger
():
# creating rotating logging
__logger__
=
logging
.
getLogger
(
''
)
__logger__
.
setLevel
(
logging
.
INFO
)
file_path
=
"script/logging/"
formatter
=
logging
.
Formatter
(
'
%(asctime)
s -
%(levelname)-6
s -
%(message)
s'
,
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
)
log_file
=
os
.
path
.
join
(
f
"{file_path}exceptions.log"
)
temp_handler
=
RotatingFileHandler
(
log_file
,
maxBytes
=
1
,
backupCount
=
10
)
temp_handler
.
setFormatter
(
formatter
)
__logger__
.
addHandler
(
temp_handler
)
return
__logger__
logger
=
get_logger
()
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