Skip to content

Commit

Permalink
change sms to priority route
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiebones committed Apr 20, 2021
1 parent 1a3edb6 commit 8e2f46c
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion client/src/globalStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ const GlobalStyle = createGlobalStyle`
}
`;

export default GlobalStyle;
export default GlobalStyle;
2 changes: 2 additions & 0 deletions server/logs/app.log
Original file line number Diff line number Diff line change
Expand Up @@ -638,3 +638,5 @@
{"error":{"code":"EADDRINUSE","errno":"EADDRINUSE","syscall":"listen","address":"::","port":8000},"level":"error","message":"uncaughtException: listen EADDRINUSE: address already in use :::8000\nError: listen EADDRINUSE: address already in use :::8000\n at Server.setupListenHandle [as _listen2] (net.js:1316:16)\n at listenInCluster (net.js:1364:12)\n at Server.listen (net.js:1450:7)\n at StartUp (/usr/app/src/index.js:111:14)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)","stack":"Error: listen EADDRINUSE: address already in use :::8000\n at Server.setupListenHandle [as _listen2] (net.js:1316:16)\n at listenInCluster (net.js:1364:12)\n at Server.listen (net.js:1450:7)\n at StartUp (/usr/app/src/index.js:111:14)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)","exception":true,"date":"Sun Mar 28 2021 18:50:12 GMT+0000 (Coordinated Universal Time)","process":{"pid":2378,"uid":0,"gid":0,"cwd":"/usr/app","execPath":"/usr/local/bin/node","version":"v12.20.1","argv":["node","/usr/app/src/index.js"],"memoryUsage":{"rss":565899264,"heapTotal":412860416,"heapUsed":309370440,"external":20574680,"arrayBuffers":18507461}},"os":{"loadavg":[5.52,4.21,3.48],"uptime":467755},"trace":[{"column":16,"file":"net.js","function":"Server.setupListenHandle [as _listen2]","line":1316,"method":"setupListenHandle [as _listen2]","native":false},{"column":12,"file":"net.js","function":"listenInCluster","line":1364,"method":null,"native":false},{"column":7,"file":"net.js","function":"Server.listen","line":1450,"method":"listen","native":false},{"column":14,"file":"/usr/app/src/index.js","function":"StartUp","line":111,"method":null,"native":false},{"column":5,"file":"internal/process/task_queues.js","function":"processTicksAndRejections","line":97,"method":null,"native":false}]}
{"error":{"code":"EADDRINUSE","errno":"EADDRINUSE","syscall":"listen","address":"::","port":8000},"level":"error","message":"uncaughtException: listen EADDRINUSE: address already in use :::8000\nError: listen EADDRINUSE: address already in use :::8000\n at Server.setupListenHandle [as _listen2] (net.js:1316:16)\n at listenInCluster (net.js:1364:12)\n at Server.listen (net.js:1450:7)\n at StartUp (/usr/app/src/index.js:111:14)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)","stack":"Error: listen EADDRINUSE: address already in use :::8000\n at Server.setupListenHandle [as _listen2] (net.js:1316:16)\n at listenInCluster (net.js:1364:12)\n at Server.listen (net.js:1450:7)\n at StartUp (/usr/app/src/index.js:111:14)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)","exception":true,"date":"Sun Mar 28 2021 18:55:52 GMT+0000 (Coordinated Universal Time)","process":{"pid":8686,"uid":0,"gid":0,"cwd":"/usr/app","execPath":"/usr/local/bin/node","version":"v12.20.1","argv":["node","/usr/app/src/index.js"],"memoryUsage":{"rss":1779183616,"heapTotal":1601847296,"heapUsed":1557823480,"external":47542903,"arrayBuffers":18515020}},"os":{"loadavg":[6.09,4.66,3.78],"uptime":468095},"trace":[{"column":16,"file":"net.js","function":"Server.setupListenHandle [as _listen2]","line":1316,"method":"setupListenHandle [as _listen2]","native":false},{"column":12,"file":"net.js","function":"listenInCluster","line":1364,"method":null,"native":false},{"column":7,"file":"net.js","function":"Server.listen","line":1450,"method":"listen","native":false},{"column":14,"file":"/usr/app/src/index.js","function":"StartUp","line":111,"method":null,"native":false},{"column":5,"file":"internal/process/task_queues.js","function":"processTicksAndRejections","line":97,"method":null,"native":false}]}
{"error":{"errno":"ECONNREFUSED","code":"ECONNREFUSED","syscall":"connect","address":"192.168.0.3","port":6379},"level":"error","message":"uncaughtException: Redis connection to redis_cache:6379 failed - connect ECONNREFUSED 192.168.0.3:6379\nError: Redis connection to redis_cache:6379 failed - connect ECONNREFUSED 192.168.0.3:6379\n at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16)","stack":"Error: Redis connection to redis_cache:6379 failed - connect ECONNREFUSED 192.168.0.3:6379\n at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16)","exception":true,"date":"Mon Mar 29 2021 08:03:42 GMT+0000 (Coordinated Universal Time)","process":{"pid":62,"uid":0,"gid":0,"cwd":"/usr/app","execPath":"/usr/local/bin/node","version":"v12.20.1","argv":["node","/usr/app/src/index.js"],"memoryUsage":{"rss":440717312,"heapTotal":295014400,"heapUsed":292567848,"external":20597012,"arrayBuffers":18531081}},"os":{"loadavg":[4.08,3.65,3.39],"uptime":515366},"trace":[{"column":16,"file":"net.js","function":"TCPConnectWrap.afterConnect [as oncomplete]","line":1144,"method":"afterConnect [as oncomplete]","native":false}]}
{"error":{"code":"EADDRINUSE","errno":"EADDRINUSE","syscall":"listen","address":"::","port":8000},"level":"error","message":"uncaughtException: listen EADDRINUSE: address already in use :::8000\nError: listen EADDRINUSE: address already in use :::8000\n at Server.setupListenHandle [as _listen2] (net.js:1316:16)\n at listenInCluster (net.js:1364:12)\n at Server.listen (net.js:1450:7)\n at StartUp (/usr/app/src/index.js:111:14)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)","stack":"Error: listen EADDRINUSE: address already in use :::8000\n at Server.setupListenHandle [as _listen2] (net.js:1316:16)\n at listenInCluster (net.js:1364:12)\n at Server.listen (net.js:1450:7)\n at StartUp (/usr/app/src/index.js:111:14)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)","exception":true,"date":"Mon Apr 05 2021 17:32:51 GMT+0000 (Coordinated Universal Time)","process":{"pid":1117,"uid":0,"gid":0,"cwd":"/usr/app","execPath":"/usr/local/bin/node","version":"v12.20.1","argv":["node","/usr/app/src/index.js"],"memoryUsage":{"rss":671449088,"heapTotal":575016960,"heapUsed":518179488,"external":20575091,"arrayBuffers":18507872}},"os":{"loadavg":[3.24,3.45,3.62],"uptime":604097},"trace":[{"column":16,"file":"net.js","function":"Server.setupListenHandle [as _listen2]","line":1316,"method":"setupListenHandle [as _listen2]","native":false},{"column":12,"file":"net.js","function":"listenInCluster","line":1364,"method":null,"native":false},{"column":7,"file":"net.js","function":"Server.listen","line":1450,"method":"listen","native":false},{"column":14,"file":"/usr/app/src/index.js","function":"StartUp","line":111,"method":null,"native":false},{"column":5,"file":"internal/process/task_queues.js","function":"processTicksAndRejections","line":97,"method":null,"native":false}]}
{"error":{"code":"EADDRINUSE","errno":"EADDRINUSE","syscall":"listen","address":"::","port":8000},"level":"error","message":"uncaughtException: listen EADDRINUSE: address already in use :::8000\nError: listen EADDRINUSE: address already in use :::8000\n at Server.setupListenHandle [as _listen2] (net.js:1316:16)\n at listenInCluster (net.js:1364:12)\n at Server.listen (net.js:1450:7)\n at StartUp (/usr/app/src/index.js:111:14)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)","stack":"Error: listen EADDRINUSE: address already in use :::8000\n at Server.setupListenHandle [as _listen2] (net.js:1316:16)\n at listenInCluster (net.js:1364:12)\n at Server.listen (net.js:1450:7)\n at StartUp (/usr/app/src/index.js:111:14)\n at processTicksAndRejections (internal/process/task_queues.js:97:5)","exception":true,"date":"Tue Apr 20 2021 08:00:26 GMT+0000 (Coordinated Universal Time)","process":{"pid":173,"uid":0,"gid":0,"cwd":"/usr/app","execPath":"/usr/local/bin/node","version":"v12.20.1","argv":["node","/usr/app/src/index.js"],"memoryUsage":{"rss":675323904,"heapTotal":565821440,"heapUsed":518385640,"external":20574047,"arrayBuffers":18506828}},"os":{"loadavg":[3.73,3.1,3.03],"uptime":435034},"trace":[{"column":16,"file":"net.js","function":"Server.setupListenHandle [as _listen2]","line":1316,"method":"setupListenHandle [as _listen2]","native":false},{"column":12,"file":"net.js","function":"listenInCluster","line":1364,"method":null,"native":false},{"column":7,"file":"net.js","function":"Server.listen","line":1450,"method":"listen","native":false},{"column":14,"file":"/usr/app/src/index.js","function":"StartUp","line":111,"method":null,"native":false},{"column":5,"file":"internal/process/task_queues.js","function":"processTicksAndRejections","line":97,"method":null,"native":false}]}
3 changes: 2 additions & 1 deletion server/src/config/isAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default (req) => {
if (!decodedToken) {
return null;
}
const { id, email, regNumber, accessLevel, active } = decodedToken;
const { id, email, regNumber, accessLevel, active, userType } = decodedToken;

if (!active) {
return null;
Expand All @@ -34,5 +34,6 @@ export default (req) => {
regNumber,
accessLevel,
active,
userType
};
};
26 changes: 13 additions & 13 deletions server/src/config/redis-client.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// redis-client.js
const redis = require("redis");
const { promisify } = require("util");
const client = redis.createClient(process.env.REDIS_URL);
// const redis = require("redis");
// const { promisify } = require("util");
// const client = redis.createClient(process.env.REDIS_URL);

export default {
...client,
getAsync: promisify(client.get).bind(client),
delAsync: promisify(client.del).bind(client),
setAsync: promisify(client.set).bind(client),
keysAsync: promisify(client.keys).bind(client),
hmsetAsync:promisify(client.hmset).bind(client),
hgetallAsync:promisify(client.hgetall).bind(client),
hdelAsync:promisify(client.hdel).bind(client),
};
// export default {
// ...client,
// getAsync: promisify(client.get).bind(client),
// delAsync: promisify(client.del).bind(client),
// setAsync: promisify(client.set).bind(client),
// keysAsync: promisify(client.keys).bind(client),
// hmsetAsync:promisify(client.hmset).bind(client),
// hgetallAsync:promisify(client.hgetall).bind(client),
// hdelAsync:promisify(client.hdel).bind(client),
// };
2 changes: 1 addition & 1 deletion server/src/methods/confirmPhoneTable/confirmPhoneNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const _setCode = () => {

export default async ({ number, regNumber, conn }) => {
const code = _setCode();
let msg = `your confirmation code is ${code}`;
let msg = `your confirmation digit is ${code}`;

try {
//await axios.post(api);
Expand Down
2 changes: 1 addition & 1 deletion server/src/methods/message/cheapGlobalSMS.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const checkSMSCredit = async () => {

const sendMessage = async ({ receipents, sender, message }) => {
const smsRequest = await axios.get(
`${CheapGlobalSmsGateway}?sub_account=${CheapGlobalSmsSubAccount}&sub_account_pass=${CheapGlobalSmsSubAccountPassword}&action=send_sms&sender_id=${sender}&message=${message}&recipients=${receipents}&type=0`
`${CheapGlobalSmsGateway}?sub_account=${CheapGlobalSmsSubAccount}&sub_account_pass=${CheapGlobalSmsSubAccountPassword}&action=send_sms&sender_id=${sender}&message=${message}&recipients=${receipents}&type=0&route=1`
);

const response = smsRequest.data;
Expand Down
2 changes: 2 additions & 0 deletions server/src/methods/studentBio/confirmStudentShip.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ const { NODE_ENV } = process.env;
export default (regNumber, conn) => {
if (NODE_ENV === "development") {
return _confirmStatusDevelopment(regNumber, conn);
} else{
return _confirmStatusDevelopment(regNumber, conn);
}
};

Expand Down
2 changes: 1 addition & 1 deletion server/src/modules/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class InitTask {
email: "jamiebones147@gmail.com",
password: hash,
accessLevel: "super-admin",
userType: "staff",
userType: "super-admin",
name: "James Oshomah",
};
const adminUser = new models.User(admin);
Expand Down

0 comments on commit 8e2f46c

Please sign in to comment.