diff options
author | Eric Wong <e@80x24.org> | 2021-03-25 06:20:18 +0200 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-03-25 17:58:56 +0000 |
commit | c4012d44fda18cc36cf8cc6d2799abe2d56887c7 (patch) | |
tree | 793be06ee724ed3bf2b67aa844c057fd6fd64f9f /lib | |
parent | d0ec7d8ddb8cb00dfb8372eaf8f5374be5e49460 (diff) | |
download | public-inbox-c4012d44fda18cc36cf8cc6d2799abe2d56887c7.tar.gz |
We need to rely on this to keep our config cache (and lei_store pipes) under control with tests each creating a new config and directory.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/PublicInbox/LEI.pm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index e5211764..d534f1d0 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -705,6 +705,12 @@ sub _lei_cfg ($;$) { File::Spec->canonpath($cfg->{'leistore.dir'})) { $cfg->{-lei_store} = $sto; } + if (scalar(keys %PATH2CFG) > 5) { + # FIXME: use inotify/EVFILT_VNODE to detect unlinked configs + for my $k (keys %PATH2CFG) { + delete($PATH2CFG{$k}) unless -f $k + } + } $self->{cfg} = $PATH2CFG{$f} = $cfg; } |