-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for custom settings for Reindexer #19
Conversation
… into feature/add_transaction_support
…s' into feature/add_transaction_support
# Conflicts: # pyreindexer/lib/include/queryresults_wrapper.h # pyreindexer/lib/src/rawpyreindexer.cc # pyreindexer/lib/src/rawpyreindexer.h
# Conflicts: # README.md # pyreindexer/example/main.py # pyreindexer/lib/include/queryresults_wrapper.h # pyreindexer/lib/include/transaction_wrapper.h # pyreindexer/lib/src/rawpyreindexer.cc # pyreindexer/lib/src/rawpyreindexer.h # pyreindexer/lib/src/reindexerinterface.cc # pyreindexer/lib/src/reindexerinterface.h # pyreindexer/query_results.py # pyreindexer/raiser_mixin.py # pyreindexer/rx_connector.py # pyreindexer/tests/tests/test_transaction.py # pyreindexer/transaction.py # readmegen.sh
…g_support # Conflicts: # pyreindexer/example/main.py # pyreindexer/lib/src/reindexerinterface.h # pyreindexer/rx_connector.py
# Conflicts: # README.md # pyreindexer/example/main.py # pyreindexer/lib/include/pyobjtools.cc # pyreindexer/lib/include/pyobjtools.h # pyreindexer/lib/include/query_wrapper.cc # pyreindexer/lib/include/query_wrapper.h # pyreindexer/lib/include/transaction_wrapper.h # pyreindexer/lib/src/rawpyreindexer.cc # pyreindexer/lib/src/rawpyreindexer.h # pyreindexer/lib/src/reindexerinterface.cc # pyreindexer/lib/src/reindexerinterface.h # pyreindexer/rx_connector.py # pyreindexer/transaction.py
|
||
template <> | ||
ReindexerInterface<reindexer::client::CoroReindexer>::ReindexerInterface() { | ||
ReindexerInterface<reindexer::client::CoroReindexer>::ReindexerInterface(const ReindexerConfig& cfg) | ||
: db_(reindexer::client::ReindexerConfig(4, 1, cfg.fetchAmount, 0, cfg.connectTimeout, cfg.requestTimeout, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вот у этого конфига, как я вижу, на v3 и v4 отличаются конструкторы. Для совместимости с обеими версиями, чтобы не ждать полного переезда на v4, можно сейчас сделать что-то типа такого:
static reindexer::client::ReindexerConfig makeClientConfig(const ReindexerConfig& cfg) {
reindexer::client::ReindexerConfig cfg;
cfg.FetchAmout = cfg.fetchAmount;
// ... для остальных опций - аналогично
return cfg;
}
И в конструкторе тогда инициализировать db_ вот так:
db_{makeClientConfig(cfg)}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно, но толку немного. Есть важный параметр в v4: milliseconds _NetTimeout = milliseconds(0),
а в v3:
seconds _ConnectTimeout = seconds(0),
seconds _RequestTimeout = seconds(0),
И получится для совместимости без него\их нужно работать
# Conflicts: # pyreindexer/lib/src/rawpyreindexer.cc
dsn (string): The connection string which contains a protocol
Examples: 'builtin:///tmp/pyrx', 'cproto://127.0.0.1:6534/pyrx'
cproto options:
built-in options: