mirror of
https://github.com/unraid/api.git
synced 2026-05-03 05:31:19 -05:00
chore: remove console usage
This commit is contained in:
@@ -371,7 +371,7 @@ export const graphql = {
|
|||||||
wsHasDisconnected(websocketId);
|
wsHasDisconnected(websocketId);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
context: ({req, connection, ...args_}, ...args__) => {
|
context: ({ req, connection }) => {
|
||||||
// Normal Websocket connection
|
// Normal Websocket connection
|
||||||
if (connection && Object.keys(connection.context).length >= 1) {
|
if (connection && Object.keys(connection.context).length >= 1) {
|
||||||
// Check connection for metadata
|
// Check connection for metadata
|
||||||
@@ -388,8 +388,7 @@ export const graphql = {
|
|||||||
user
|
user
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log({req, connection, args_, args__});
|
|
||||||
throw new Error('Invalid');
|
throw new Error('Invalid');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+2
-2
@@ -8,8 +8,8 @@ const log = console;
|
|||||||
const { loadState } = utils;
|
const { loadState } = utils;
|
||||||
const { varState } = states;
|
const { varState } = states;
|
||||||
|
|
||||||
process.on('uncaughtException', console.log);
|
process.on('uncaughtException', log.debug);
|
||||||
process.on('unhandledRejection', console.log);
|
process.on('unhandledRejection', log.debug);
|
||||||
|
|
||||||
const internalWsAddress = () => {
|
const internalWsAddress = () => {
|
||||||
const port = config.get('graphql-api-port');
|
const port = config.get('graphql-api-port');
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ export const publish = (channel: string, mutation: string, node?: {}) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (!canPublishToChannel(channel)) {
|
if (!canPublishToChannel(channel)) {
|
||||||
// console.log(`can't post to ${channel}`);
|
log.debug(`can't post to ${channel}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,14 +76,12 @@ export const wsHasDisconnected = (id: string) => {
|
|||||||
export const canPublishToChannel = (channel: string) => {
|
export const canPublishToChannel = (channel: string) => {
|
||||||
// No ws connections
|
// No ws connections
|
||||||
if (getWsConectionCount() === 0) {
|
if (getWsConectionCount() === 0) {
|
||||||
// log.debug('No ws connections, cannot publish');
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// No ws connections to this channel
|
// No ws connections to this channel
|
||||||
const channelConnectionCount = getWsConectionCountInChannel(channel);
|
const channelConnectionCount = getWsConectionCountInChannel(channel);
|
||||||
if (channelConnectionCount === 0) {
|
if (channelConnectionCount === 0) {
|
||||||
// log.debug(`No connections to channel ${channel}`);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user