# fluent-booking/2.4.0/app/Hooks/Scheduler/DailyScheduler.php

Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution, version 2.4.0. 32 lines.

- Page: https://pluginprobe.com/plugins/fluent-booking/2.4.0/code/app/Hooks/Scheduler/DailyScheduler.php
- Raw: https://pluginprobe.com/plugins/fluent-booking/2.4.0/raw/app/Hooks/Scheduler/DailyScheduler.php
- Modified: 2026-09-09T13:29:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-booking/2.4.0/code/app/Hooks/Scheduler/DailyScheduler.php#L10-L20`.

```php
<?php

namespace FluentBooking\App\Hooks\Scheduler;

use FluentBooking\App\Modules\MCP\Support\WriteGuard;
use FluentBooking\App\Services\SummaryReportService;

class DailyScheduler
{
    public function register()
    {
        add_action('fluent_booking/daily_tasks', [$this, 'handleDailyTasks']);
    }

    public function handleDailyTasks()
    {
        // The purge runs first, and in its own try: MCP confirm-token and
        // idempotency records live in options rather than transients (they
        // need an atomic claim and must survive a cache flush), so nothing
        // else expires them — and behind the summary, a slow or throwing
        // summary would starve them out of the tick indefinitely.
        try {
            WriteGuard::purgeExpired();
        } catch (\Throwable $e) {
            if (defined('FLUENT_BOOKING_DEBUG') && FLUENT_BOOKING_DEBUG) {
                error_log('FluentBooking MCP purge failed: ' . $e->getMessage()); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
            }
        }

        SummaryReportService::maybeSendSummary();
    }
}
```
