GladysProject/Gladys

View on GitHub
server/lib/device/device.onPurgeStatesEvent.js

Summary

Maintainability
A
0 mins
Test Coverage
const { JOB_TYPES } = require('../../utils/constants');

/**
 * @description It's time to do the daily purge of state events.
 * @example
 * onPurgeStatesEvent()
 */
async function onPurgeStatesEvent() {
  const purgeAllStates = this.job.wrapper(JOB_TYPES.DEVICE_STATES_PURGE, async () => {
    await this.purgeStates();
  });
  await purgeAllStates();
}

module.exports = {
  onPurgeStatesEvent,
};