From ac9e15e812f90bdba750ff1948c93eea7991cdb5 Mon Sep 17 00:00:00 2001 From: dakkar Date: Sun, 29 Dec 2019 18:48:42 +0000 Subject: log end-of-scan --- lib/MaildirIndexer/LogTimelineSchema.rakumod | 2 ++ lib/MaildirIndexer/Store.rakumod | 1 + 2 files changed, 3 insertions(+) diff --git a/lib/MaildirIndexer/LogTimelineSchema.rakumod b/lib/MaildirIndexer/LogTimelineSchema.rakumod index 1e1848f..ea0d2fc 100644 --- a/lib/MaildirIndexer/LogTimelineSchema.rakumod +++ b/lib/MaildirIndexer/LogTimelineSchema.rakumod @@ -2,6 +2,8 @@ use v6.d; unit module MaildirIndexer::LogTimelineSchema; use Log::Timeline; +class Scan::End does Log::Timeline::Event['MaildirIndexer','ScanDir','end of initial scan'] { }; + class Store::Add does Log::Timeline::Task['MaildirIndexer','Store','add file'] { }; class Store::Rm does Log::Timeline::Task['MaildirIndexer','Store','rm file'] { }; class Store::Find does Log::Timeline::Task['MaildirIndexer','Store','finding mailbox'] { }; diff --git a/lib/MaildirIndexer/Store.rakumod b/lib/MaildirIndexer/Store.rakumod index 03492f7..2144ddf 100644 --- a/lib/MaildirIndexer/Store.rakumod +++ b/lib/MaildirIndexer/Store.rakumod @@ -22,6 +22,7 @@ method start(--> Nil) { CATCH { warn $_ }; whenever $.file-channel -> $file { when $file ~~ MaildirIndexer::ScanDir::End { + MaildirIndexer::LogTimelineSchema::Scan::End.log(); } when $file ~~ :e & :f { MaildirIndexer::LogTimelineSchema::Store::Add.log: :file($file.path), -> { -- cgit v1.2.3