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

Merge branch 'core-sit' into 'core-staging'

Core sit

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