Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async run ({ params, response }) {
const { chatRoom } = ActionHero.api
response.didCreate = await chatRoom.add(params.name)
}
}
async checkEventLoop (data) {
const api = ActionHero.api
const eventLoopDelay = await api.utils.eventLoopDelay(10000)
data.response.eventLoopDelay = eventLoopDelay
if (eventLoopDelay > maxEventLoopDelay) {
data.response.nodeStatus = data.connection.localize('Node Unhealthy')
data.response.problems.push(data.connection.localize(['EventLoop Blocked for more than {{maxEventLoopDelay}} ms', { maxEventLoopDelay: maxEventLoopDelay }]))
}
}
async checkResqueQueues (data) {
const api = ActionHero.api
const details = await api.tasks.details()
let length = 0
Object.keys(details.queues).forEach((q) => {
length += details.queues[q].length
})
data.response.resqueTotalQueueLength = length
if (length > maxResqueQueueLength) {
data.response.nodeStatus = data.connection.localize('Node Unhealthy')
data.response.problems.push(data.connection.localize(['Resque Queues over {{maxResqueQueueLength}} jobs', { maxResqueQueueLength: maxResqueQueueLength }]))
}
}
run ({ response }) {
const { documentation } = ActionHero.api
response.documentation = documentation.documentation
}
}
run ({ response }) {
const { documentation } = ActionHero.api
response.documentation = documentation.documentation
}
}