Files
maintenance-tools/maintenance_service_http_monitoring/data/cron.xml
Stéphan Sainléger 0e32152278
Some checks failed
pre-commit / pre-commit (pull_request) Has been cancelled
[IMP] maintenance_service_http_monitoring : speed up KO confirmation
The previous design required two passes of the 10-minute sweep before a
maintenance request was created, so an outage took at least ~10 extra
minutes (up to 20) to be reported.

Split the monitoring into two crons with distinct responsibilities:

- the 10-minute sweep only discovers outages, flags the KO streak via
  ``http_first_ko_at`` and auto-resolves recovered services;
- a new 2-minute confirmation cron re-checks only the flagged services
  and creates a request once the service has been continuously KO for
  ``HTTP_KO_CONFIRMATION_DELAY`` (lowered from 5 to 2 minutes).

This keeps the transient-outage filter while removing the extra sweep
latency. Services already under an open request are skipped by the
confirmation cron and remain handled by the sweep.
2026-09-18 23:13:26 +02:00

33 lines
1.5 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="ir_cron_http_service_monitoring" model="ir.cron">
<field name="name">HTTP Service Monitoring : check all services</field>
<field name="model_id" ref="maintenance_server_data.model_service_instance" />
<field name="state">code</field>
<field name="code">model.cron_check_http_services()</field>
<field name="interval_number">10</field>
<field name="interval_type">minutes</field>
</record>
<record id="ir_cron_http_service_confirmation" model="ir.cron">
<field name="name">HTTP Service Monitoring : confirm KO services</field>
<field name="model_id" ref="maintenance_server_data.model_service_instance" />
<field name="state">code</field>
<field name="code">model.cron_confirm_http_ko_services()</field>
<field name="interval_number">2</field>
<field name="interval_type">minutes</field>
</record>
<record id="ir_cron_maintenance_mode_expiry" model="ir.cron">
<field
name="name"
>HTTP Service Monitoring : deactivate expired maintenance mode</field>
<field
name="model_id"
ref="maintenance_server_data.model_maintenance_equipment"
/>
<field name="state">code</field>
<field name="code">model.cron_deactivate_expired_maintenance_mode()</field>
<field name="interval_number">15</field>
<field name="interval_type">minutes</field>
</record>
</odoo>