d11ddff912
CI / test (push) Has been cancelled
Frame settings now offer two update-frequency modes: "at specific times" or "every X minutes". Times are stored as an int[] of minutes-since-midnight, allowing multiple slots per day at minute granularity. Backend computes the earliest upcoming slot for X-Interval-Ms and uses the most-recent-past slot as the rotation-due boundary. PWA settings sheet has hour/minute/AM-PM dropdowns with + Add / trash, a live "next update" preview, and a note that changes only take effect at the device's next sync. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
34 lines
1.1 KiB
PHP
34 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use App\Message\RunImageCleanupMessage;
|
|
use Symfony\Component\Scheduler\Attribute\AsSchedule;
|
|
use Symfony\Component\Scheduler\RecurringMessage;
|
|
use Symfony\Component\Scheduler\Schedule as SymfonySchedule;
|
|
use Symfony\Component\Scheduler\ScheduleProviderInterface;
|
|
use Symfony\Contracts\Cache\CacheInterface;
|
|
|
|
#[AsSchedule]
|
|
class Schedule implements ScheduleProviderInterface
|
|
{
|
|
public function __construct(
|
|
private CacheInterface $cache,
|
|
) {
|
|
}
|
|
|
|
public function getSchedule(): SymfonySchedule
|
|
{
|
|
// Rotation is handled at poll time in DeviceImageController — no scheduler needed.
|
|
// DEV/PROD note: when switching to wakeTimes mode, the device only polls
|
|
// at each configured time, so rotation still happens correctly (isDue()
|
|
// fires on each scheduled poll).
|
|
return (new SymfonySchedule())
|
|
->stateful($this->cache)
|
|
->processOnlyLastMissedRun(true)
|
|
->add(
|
|
RecurringMessage::cron('0 * * * *', new RunImageCleanupMessage()),
|
|
);
|
|
}
|
|
}
|