Makd SecurityCache external to MDConsumer so it live beyond md recovery
This commit is contained in:
1 parent
40a115de7e
commit
791b0fdbc1
13 files changed
+68
-40
No files matched your search
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "lib/config/protos/system.pb.h"
|
||||
#include "lib/md/protos/co2.pb.h"
|
||||
#include "lib/md/SecurityCache.h"
|
||||
#include "lib/api/apicore.pb.h"
|
||||
#include "lib/api/services/MarketDataRelay.server.pb.h"
|
||||
#include "lib/api/public/ServiceContext.h"
|
||||
@@ -162,6 +163,7 @@ void copy_misc(IntPrice settlement, MiscData misc, co2::MiscMessage* pmisc) {
|
||||
|
||||
// Handles market data queries and responds
|
||||
class QueryServerImpl : public IQueryServer {
|
||||
SecurityCache _cache;
|
||||
MDConsumer _consumer;
|
||||
const std::set<UserSymbol> _symbols;
|
||||
const std::shared_ptr<api::ISyntheticSecurityService> _ss;
|
||||
@@ -169,7 +171,8 @@ class QueryServerImpl : public IQueryServer {
|
||||
|
||||
public:
|
||||
QueryServerImpl(const std::set<UserSymbol>& symbols, std::shared_ptr<api::ISyntheticSecurityService>& ss, metrics::MetricsContainer& stats) :
|
||||
_consumer(symbols, ss),
|
||||
_cache(),
|
||||
_consumer(symbols, ss, _cache),
|
||||
_symbols(symbols),
|
||||
_ss(ss),
|
||||
_groups()
|
||||
@@ -211,7 +214,8 @@ public:
|
||||
// not-reentrant
|
||||
void check_heartbeats(utils::Dispatcher& dispatcher) {
|
||||
if (!_consumer.all_heartbeats_ok()) {
|
||||
MDConsumer temp(_symbols, _ss);
|
||||
SecurityCache cache;
|
||||
MDConsumer temp(_symbols, _ss, cache);
|
||||
if (temp.all_heartbeats_ok()) {
|
||||
_consumer.swap(temp);
|
||||
LOG(md,Info, "Recovering from bad MD. Old consumer {} new consumer {}", _consumer.id(), temp.id());
|
||||
|
||||
Reference in new issue
Block a user