@golemio/parkings
Version:
Golemio Parkings Module
27 lines • 1.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.UpdateParkingSourceTask = void 0;
const integration_engine_1 = require("@golemio/core/dist/integration-engine");
const ParkingSourceSchema_1 = require("../schemas/ParkingSourceSchema");
class UpdateParkingSourceTask extends integration_engine_1.AbstractTask {
constructor(queuePrefix, log, repository, integrationChecker) {
super(queuePrefix);
this.log = log;
this.repository = repository;
this.integrationChecker = integrationChecker;
this.queueName = "updateParkingSource";
this.queueTtl = 3 * 60 * 60 * 1000; // 3h
this.schema = ParkingSourceSchema_1.UpdateParkingSourceValidationSchema;
}
async execute(data) {
try {
this.integrationChecker.checkAllowedDataSources(data);
await this.repository.save(data);
}
catch (err) {
this.log.error(`Error while updating parking source: ${err}`);
}
}
}
exports.UpdateParkingSourceTask = UpdateParkingSourceTask;
//# sourceMappingURL=UpdateParkingSourceTask.js.map