UNPKG

@grouparoo/core

Version:
27 lines (26 loc) 907 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CLSInitializer = void 0; const actionhero_1 = require("actionhero"); const cls_1 = require("../../modules/cls"); class CLSInitializer extends actionhero_1.Initializer { constructor() { super(); } async initialize() { if (typeof this.initializeWithinTransaction === "function") { return cls_1.CLS.wrap(async () => await this.initializeWithinTransaction()); } } async start() { if (typeof this.startWithinTransaction === "function") { return cls_1.CLS.wrap(async () => await this.startWithinTransaction()); } } async stop() { if (typeof this.stopWithinTransaction === "function") { return cls_1.CLS.wrap(async () => await this.stopWithinTransaction()); } } } exports.CLSInitializer = CLSInitializer;