1
0
Fork 0

Comment for PR9839

This commit is contained in:
KVS85 2019-09-19 12:31:31 +02:00
parent d0d4d8d815
commit 31e4f9d1dc
1 changed files with 10 additions and 7 deletions

View File

@ -1962,18 +1962,21 @@ void Agent::emptyCbTrashBin() {
_callbackLastPurged = std::chrono::steady_clock::now();
}
// Best effort. Will be retried otherwise.
// This is a best effort attempt. If either the queueing or the write fail,
// while above _callbackTrashBin has been cleaned, entries will repopulate with
// future 404 errors, when they are triggered again. So either way these attempts
// are repeated until such time, when the callbacks are gone successfully through
// queue + write.
LOG_TOPIC(DEBUG, Logger::AGENCY) << "scheduling unobserve: " << envelope->toJson();
auto* scheduler = SchedulerFeature::SCHEDULER;
if (scheduler != nullptr) {
scheduler->queue(
RequestPriority::LOW, [envelope](bool) {
auto* agent = AgencyFeature::AGENT;
if (!application_features::ApplicationServer::isStopping() && agent) {
agent->write(envelope);
}
});
auto* agent = AgencyFeature::AGENT;
if (!application_features::ApplicationServer::isStopping() && agent) {
agent->write(envelope);
}
});
}
}