/* |-------------------------------------------------------------------------- | Background monitors |-------------------------------------------------------------------------- | | Started with the HTTP server only (not with the ace commands): host | metrics, containers stats, site checks and the daily backup. | */ import app from '@adonisjs/core/services/app' import backupService from '#services/backup_service' import dockerService from '#services/docker_service' import metricsService from '#services/metrics_service' import siteMonitor from '#services/site_monitor' app.ready(() => { metricsService.start() dockerService.startStatsPolling() siteMonitor.start() backupService.startSchedule() }) app.terminating(() => { metricsService.stop() dockerService.stopStatsPolling() siteMonitor.stop() backupService.stopSchedule() })