salix/modules/agency/back/models/zone-closure.js

14 lines
410 B
JavaScript

module.exports = Self => {
Self.doRecalc = async function() {
try {
await Self.rawSql(`
CREATE EVENT zoneClosure_doRecalc
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 15 SECOND
DO CALL zoneClosure_recalc;
`);
} catch (err) {
if (err.code != 'ER_EVENT_ALREADY_EXISTS') throw err;
}
};
};