… | |
… | |
79 | |
79 | |
80 | # we don't actually care if it succeeds or not, as we |
80 | # we don't actually care if it succeeds or not, as we |
81 | # will just retry an hour later |
81 | # will just retry an hour later |
82 | BDB::db_txn_finish $txn; |
82 | BDB::db_txn_finish $txn; |
83 | |
83 | |
84 | # warn "tag-updated $file (= $key) $hash\n";#d# |
84 | warn "tag-updated $file (= $key) <@tags>\n" |
|
|
85 | if @tags; |
85 | } |
86 | } |
86 | |
87 | |
87 | sub scan_static { |
88 | sub scan_static { |
88 | my ($dir, $map) = @_; |
89 | my ($dir, $map) = @_; |
89 | |
90 | |
… | |
… | |
101 | &scan_static ("$dir/$_", "$map$_/") |
102 | &scan_static ("$dir/$_", "$map$_/") |
102 | for @$dirs; |
103 | for @$dirs; |
103 | } |
104 | } |
104 | |
105 | |
105 | sub reload { |
106 | sub reload { |
|
|
107 | my $guard = cf::lock_acquire "map-tags::reload"; |
|
|
108 | |
106 | my $start = Event::time; |
109 | my $start = Event::time; |
107 | |
110 | |
108 | # 1. check for maps no longer existing |
111 | # 1. check for maps no longer existing |
109 | { |
112 | { |
110 | my @delkeys; |
113 | my @delkeys; |
… | |
… | |
175 | after => 0, |
178 | after => 0, |
176 | interval => $SCHEDULE_INTERVAL, |
179 | interval => $SCHEDULE_INTERVAL, |
177 | data => cf::WF_AUTOCANCEL, |
180 | data => cf::WF_AUTOCANCEL, |
178 | cb => Coro::unblock_sub { |
181 | cb => Coro::unblock_sub { |
179 | $Coro::current->prio (Coro::PRIO_MIN); |
182 | $Coro::current->prio (Coro::PRIO_MIN); |
|
|
183 | $Coro::current->desc ("map-tag scanner"); |
180 | reload; |
184 | reload; |
181 | }, |
185 | }, |
182 | ); |
186 | ); |
183 | |
187 | |
184 | # find all objects with the given tag, or at least try to |
188 | # find all objects with the given tag, or at least try to |