summaryrefslogtreecommitdiff
path: root/lib/MaildirIndexer/Store.rakumod
diff options
context:
space:
mode:
Diffstat (limited to 'lib/MaildirIndexer/Store.rakumod')
-rw-r--r--lib/MaildirIndexer/Store.rakumod7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/MaildirIndexer/Store.rakumod b/lib/MaildirIndexer/Store.rakumod
index 502d60e..03492f7 100644
--- a/lib/MaildirIndexer/Store.rakumod
+++ b/lib/MaildirIndexer/Store.rakumod
@@ -3,6 +3,7 @@ unit class MaildirIndexer::Store;
use MaildirIndexer::LogTimelineSchema;
use MaildirIndexer::Index;
use MaildirIndexer::Parser;
+use MaildirIndexer::ScanDir;
has Lock $!lock .= new;
has MaildirIndexer::Index @.indices is required;
@@ -20,12 +21,14 @@ method start(--> Nil) {
start react {
CATCH { warn $_ };
whenever $.file-channel -> $file {
- if $file.e && $file.f {
+ when $file ~~ MaildirIndexer::ScanDir::End {
+ }
+ when $file ~~ :e & :f {
MaildirIndexer::LogTimelineSchema::Store::Add.log: :file($file.path), -> {
self.add-file($file);
}
}
- elsif !$file.e {
+ when $file ~~ :!e {
MaildirIndexer::LogTimelineSchema::Store::Rm.log: :file($file.path), -> {
self.del-file($file);
}