No description
  • Perl 99.7%
  • Shell 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Mike Marion 0383ba2bc1 Throttle and consolidate iMessage notifications across rip/encode runs
Notifications used to shell out to imessage once per ripped track (ripper.pl)
and once per encoded file (encoder.pl), with no timeout. That meant a burst of
texts when several discs/encodes were running in parallel, and a hung
imessage call could stall a run indefinitely.

Add NotifyThrottle.pm, shared by both scripts:
- Messages are appended to a queue file (/tmp/ripper-notify.queue) under an
  flock shared by all instances (/tmp/ripper-notify.lock).
- At most one iMessage is sent per 5 minutes (stamp in
  /tmp/ripper-notify.last). Whoever finds the window open sends everything
  queued as a single message, one [HH:MM]-prefixed line per entry, so
  ripper and encoder messages from any number of parallel runs get
  consolidated.
- When throttled, a detached background waiter is forked so the caller
  doesn't block; it sleeps until the window opens and sends whatever is
  still queued, or exits if another instance already sent it.
- imessage is run via IPC::Run with a 120s timeout; a hung call is killed
  and treated as a failure. Failed messages are put back at the front of
  the queue and retried next window, up to 3 attempts per sender.
- imessage is invoked with a list (no shell), so titles/filenames with
  quotes or shell metacharacters no longer break the command.
- The queue lock is dropped while imessage runs, so other instances are
  never blocked behind a slow send.

ripper.pl: instead of one message per track, collect a summary of each
ripped track and send a single "Disc done" notification after the disc is
fully ripped, ejected and its device lock released. Per-track lines are
still written to the log as each track finishes.

encoder.pl: per-file "Encoding finished" notifications now go through the
shared throttled queue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 15:08:05 -07:00
.gitignore Starting work on encoder, ignore the vscode subdir 2025-01-02 13:40:42 -08:00
arm_encoder.pl Minor fixes to 3 scripts 2025-02-07 10:39:51 -08:00
encoder.pl Throttle and consolidate iMessage notifications across rip/encode runs 2026-10-07 15:08:05 -07:00
iTunMOVI-1.1.pl Saving updated encoder and iTunes metadata wrapper 2025-01-06 13:57:48 -08:00
loop_wait_rip_encode.sh pulled in my wait-then-encode script too 2025-06-26 12:59:12 -07:00
NotifyThrottle.pm Throttle and consolidate iMessage notifications across rip/encode runs 2026-10-07 15:08:05 -07:00
omdb_query.pl Replace WebService::OMDB with a direct API client 2026-09-03 10:37:07 -07:00
OmdbClient.pm Replace WebService::OMDB with a direct API client 2026-09-03 10:37:07 -07:00
ripper.pl Throttle and consolidate iMessage notifications across rip/encode runs 2026-10-07 15:08:05 -07:00