Commit bf1b0603 authored by John Red Medrano's avatar John Red Medrano

Merge branch 'core-dev' into 'core-sit'

Core dev

See merge request rms/Backend/api-main-service!930
parents 76c7433c 010edadc
......@@ -17,33 +17,24 @@ import pusher
import os
import configparser
config = configparser.ConfigParser()
config_file = os.path.join('./', 'env.ini')
config.read(config_file)
REALTIMESERVER_IP = settings.REALTIMESERVER_IP
app_id = config['SETTINGS']['app_id'],
key = config['SETTINGS']['key']
secret = config['SETTINGS']['secret']
cluster = config['SETTINGS']['cluster']
ssl = True if config['SETTINGS']['ssl'] == 1 else False
cms_notification = config['SETTINGS']['cms_notification']
SSL = False if config['SETTINGS']['SSL'] == 1 else True
def rms_websocket(my_channel, my_event, msg):
pusher_client = pusher.Pusher(
app_id=app_id,
key=key,
secret=secret,
cluster=cluster,
ssl=ssl
app_id='957253',
key='c29a7f6579108991e79e',
secret='b3df5d55196b5fbd3eff',
cluster='ap1',
ssl=True
)
pusher_client.trigger(
my_channel, my_event, msg
# 'my-channel', 'my-event', {'message': 'hello world'}
)
......@@ -245,7 +236,7 @@ def notification_create(form_code, message, account_no,
# 'NEW NOTIFICATIONS'
# )
if ssl != 1:
if SSL != True:
send_broadcast_message(
ROOM,
SENDER,
......@@ -254,7 +245,7 @@ def notification_create(form_code, message, account_no,
else:
rms_websocket(
ROOM,
cms_notification,
'cms-notification',
{'message': 'NEW NOTIFICATIONS'}
)
......
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