63 auto event =
app_.getJobQueue().makeLoadEvent(
JtPathFind,
"PathRequest::updateAll");
75 bool newRequests =
app_.getLedgerMaster().isNewPathRequest();
76 bool mustBreak =
false;
78 JLOG(
journal_.trace()) <<
"updateAll seq=" << cache->getLedger()->seq() <<
", "
79 << requests.
size() <<
" requests";
81 int processed = 0, removed = 0;
84 if (
auto ipSub = request->getSubscriber(); ipSub && ipSub->getRequest() == request)
88 request->doAborting();
94 JLOG(
journal_.trace()) <<
"updateAll looping";
95 for (
auto const& wr : requests)
97 if (
app_.getJobQueue().isStopping())
100 auto request = wr.lock();
102 JLOG(
journal_.trace()) <<
"updateAll request " << (request ?
"" :
"not ") <<
"found";
106 auto continueCallback = [&getSubscriber, &request]() {
110 return (
bool)getSubscriber(request);
112 if (!request->needsUpdate(newRequests, cache->getLedger()->seq()))
118 if (
auto ipSub = getSubscriber(request))
120 if (!ipSub->getConsumer().warn())
126 json::Value update = request->doUpdate(cache,
false, continueCallback);
127 request->updateComplete();
128 update[jss::type] =
"path_find";
129 ipSub = getSubscriber(request);
132 ipSub->send(update,
false);
138 else if (request->hasCompletion())
141 request->doUpdate(cache,
false);
142 request->updateComplete();
157 if (r && r != request)
166 mustBreak = !newRequests &&
app_.getLedgerMaster().isNewPathRequest();
178 else if (newRequests)
180 newRequests =
app_.getLedgerMaster().isNewPathRequest();
184 newRequests =
app_.getLedgerMaster().isNewPathRequest();
202 }
while (!
app_.getJobQueue().isStopping());
204 JLOG(
journal_.debug()) <<
"updateAll complete: " << processed <<
" processed and " << removed