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 ...@@ -15,29 +15,22 @@ from pusher import Pusher
import os import os
import configparser import configparser
config = configparser.ConfigParser() config = configparser.ConfigParser()
config_file = os.path.join('./', 'env.ini') config_file = os.path.join('./', 'env.ini')
config.read(config_file) config.read(config_file)
REALTIMESERVER_IP = settings.REALTIMESERVER_IP REALTIMESERVER_IP = settings.REALTIMESERVER_IP
app_id = config['SETTINGS']['app_id'], SSL = False if config['SETTINGS']['SSL'] == 1 else True
key = config['SETTINGS']['key']
secret = config['SETTINGS']['secret']
cluster = config['SETTINGS']['cluster']
ssl = config['SETTINGS']['SSL']
cms_notification = config['SETTINGS']['cms_notification']
def rms_websocket(my_channel, my_event, msg): def rms_websocket(my_channel, my_event, msg):
pusher_client = Pusher( pusher_client = pusher.Pusher(
app_id=app_id, app_id='957253',
key=key, key='c29a7f6579108991e79e',
secret=secret, secret='b3df5d55196b5fbd3eff',
cluster=cluster cluster='ap1',
ssl=True
) )
pusher_client.trigger( pusher_client.trigger(
my_channel, my_event, msg my_channel, my_event, msg
) )
...@@ -235,10 +228,16 @@ def notification_create(form_code, message, account_no, ...@@ -235,10 +228,16 @@ def notification_create(form_code, message, account_no,
ROOM = account_no ROOM = account_no
# SENDER = sender_account_no # SENDER = sender_account_no
if ssl == 1: if SSL != True:
send_broadcast_message(
ROOM,
SENDER,
'NEW NOTIFICATIONS'
)
else:
rms_websocket( rms_websocket(
ROOM, ROOM,
cms_notification, 'cms-notification',
{'message': 'NEW NOTIFICATIONS'} {'message': 'NEW NOTIFICATIONS'}
) )
else: 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