62 auto event =
app_.getJobQueue().makeLoadEvent(
JtPathFind,
"PathRequest::updateAll");
74 bool newRequests =
app_.getLedgerMaster().isNewPathRequest();
75 bool mustBreak =
false;
77 JLOG(
journal_.trace()) <<
"updateAll seq=" << cache->getLedger()->seq() <<
", "
78 << requests.
size() <<
" requests";
80 int processed = 0, removed = 0;
83 if (
auto ipSub = request->getSubscriber(); ipSub && ipSub->getRequest() == request)
87 request->doAborting();
93 JLOG(
journal_.trace()) <<
"updateAll looping";
94 for (
auto const& wr : requests)
96 if (
app_.getJobQueue().isStopping())
99 auto request = wr.lock();
101 JLOG(
journal_.trace()) <<
"updateAll request " << (request ?
"" :
"not ") <<
"found";
105 auto continueCallback = [&getSubscriber, &request]() {
109 return (
bool)getSubscriber(request);
111 if (!request->needsUpdate(newRequests, cache->getLedger()->seq()))
117 if (
auto ipSub = getSubscriber(request))
119 if (!ipSub->getConsumer().warn())
125 json::Value update = request->doUpdate(cache,
false, continueCallback);
126 request->updateComplete();
127 update[jss::type] =
"path_find";
128 ipSub = getSubscriber(request);
131 ipSub->send(update,
false);
137 else if (request->hasCompletion())
140 request->doUpdate(cache,
false);
141 request->updateComplete();
156 if (r && r != request)
165 mustBreak = !newRequests &&
app_.getLedgerMaster().isNewPathRequest();
177 else if (newRequests)
179 newRequests =
app_.getLedgerMaster().isNewPathRequest();
183 newRequests =
app_.getLedgerMaster().isNewPathRequest();
201 }
while (!
app_.getJobQueue().isStopping());
203 JLOG(
journal_.debug()) <<
"updateAll complete: " << processed <<
" processed and " << removed