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

Merge branch 'core-demo' into 'product-dev'

Core demo

See merge request rms/Backend/api-main-service!933
parents fe492af7 7ba7e4bc
......@@ -15,29 +15,22 @@ from pusher 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 = config['SETTINGS']['SSL']
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(
app_id=app_id,
key=key,
secret=secret,
cluster=cluster
pusher_client = pusher.Pusher(
app_id='957253',
key='c29a7f6579108991e79e',
secret='b3df5d55196b5fbd3eff',
cluster='ap1',
ssl=True
)
pusher_client.trigger(
my_channel, my_event, msg
)
......@@ -235,10 +228,16 @@ def notification_create(form_code, message, account_no,
ROOM = account_no
# SENDER = sender_account_no
if ssl == 1:
if SSL != True:
send_broadcast_message(
ROOM,
SENDER,
'NEW NOTIFICATIONS'
)
else:
rms_websocket(
ROOM,
cms_notification,
'cms-notification',
{'message': 'NEW NOTIFICATIONS'}
)
else:
......
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