mnemosyne/bin/mnemosyne-digest

20 lines
789 B
Perl
Executable File

#!/usr/bin/env perl
use strict;
use warnings;
use FindBin qw($RealBin);
use lib "$RealBin/../lib";
# Invoked by cron every N minutes (e.g. */5 * * * *).
# Exits immediately unless:
# a) the current local time matches digest_time (within the cron granularity window), AND
# b) last_digest_sent (config table) is not today's date.
# On success, records today's date in last_digest_sent to prevent duplicate sends.
#
# TODO: Load config + DB
# TODO: Read digest_time and last_digest_sent from config table
# TODO: Compare current local time against digest_time (allow ±(cron_interval/2) window)
# TODO: If it's time and not already sent: call Mnemosyne::Digest::send(...)
# TODO: On success: update last_digest_sent to today's ISO date
print "mnemosyne-digest: not yet implemented\n";