Added error handler
gitea/salix/pipeline/head Something is wrong with the build of this commit
Details
gitea/salix/pipeline/head Something is wrong with the build of this commit
Details
This commit is contained in:
parent
a8eea3d8f6
commit
b0779fb2d3
|
@ -26,6 +26,10 @@ module.exports = Self => {
|
||||||
Self.sendCheckingPresence = async(ctx, workerId, message) => {
|
Self.sendCheckingPresence = async(ctx, workerId, message) => {
|
||||||
const models = Self.app.models;
|
const models = Self.app.models;
|
||||||
const account = await models.Account.findById(workerId);
|
const account = await models.Account.findById(workerId);
|
||||||
|
const userId = ctx.req.accessToken.userId;
|
||||||
|
|
||||||
|
if (!account)
|
||||||
|
throw new Error(`Could not send message to worker id ${workerId} from user ${userId}`);
|
||||||
|
|
||||||
const query = `SELECT worker_isWorking(?) isWorking`;
|
const query = `SELECT worker_isWorking(?) isWorking`;
|
||||||
const [result] = await Self.rawSql(query, [workerId]);
|
const [result] = await Self.rawSql(query, [workerId]);
|
||||||
|
|
Loading…
Reference in New Issue