PluginProbe
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution / trunk
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution vtrunk
2.4.0 2.3.0 2.2.5 2.2.0 2.1.2 2.1.1 trunk 1.10.0 1.10.01 1.10.02 1.5.0 1.5.01 1.5.02 1.5.1 1.5.10 1.5.20 1.5.21 1.5.22 1.5.23 1.5.24 1.5.25 1.6.0 1.7.0 1.7.1 1.7.2 All 33 releases
fluent-booking / app / Hooks / Scheduler / DailyScheduler.php

DailyScheduler.php in Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution trunk, at app/Hooks/Scheduler/DailyScheduler.php

32 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentBooking\App\Hooks\Scheduler;
4
5 use FluentBooking\App\Modules\MCP\Support\WriteGuard;
6 use FluentBooking\App\Services\SummaryReportService;
7
8 class DailyScheduler
9 {
10 public function register()
11 {
12 add_action('fluent_booking/daily_tasks', [$this, 'handleDailyTasks']);
13 }
14
15 public function handleDailyTasks()
16 {
17 // The purge runs first, and in its own try: MCP confirm-token and
18 // idempotency records live in options rather than transients (they
19 // need an atomic claim and must survive a cache flush), so nothing
20 // else expires them — and behind the summary, a slow or throwing
21 // summary would starve them out of the tick indefinitely.
22 try {
23 WriteGuard::purgeExpired();
24 } catch (\Throwable $e) {
25 if (defined('FLUENT_BOOKING_DEBUG') && FLUENT_BOOKING_DEBUG) {
26 error_log('FluentBooking MCP purge failed: ' . $e->getMessage()); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
27 }
28 }
29
30 SummaryReportService::maybeSendSummary();
31 }
32 }