UNPKG

actionhero

Version:

The reusable, scalable, and quick node.js API server for stateless and stateful applications

31 lines (30 loc) 975 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RunAction = void 0; const index_1 = require("./../index"); class RunAction extends index_1.Task { constructor() { super(...arguments); this.name = "runAction"; this.description = "I will run an action and return the connection object"; this.frequency = 0; this.queue = "default"; } async run(params) { if (!params) params = {}; const response = await index_1.action.run(params.action, params.version, // @ts-ignore params.params); if (response.error) { (0, index_1.log)("task error: " + response.error, "error", { params: JSON.stringify(params), }); } else { (0, index_1.log)("[ action @ task ]", "debug", { params: JSON.stringify(params) }); } return response; } } exports.RunAction = RunAction;