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