Skip to content
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

Skip server-only processing in client calls to update_indexes_from_txn_log() #1430

Merged
merged 1 commit into from
Mar 25, 2022

Conversation

LaurentiuCristofor
Copy link
Contributor

Also added two constants to simplify checks about whether code is executed on server or client and re-formatted some long lines in the touched files.

@@ -7,6 +7,9 @@
#include "db_helpers.hpp"
#include "db_shared_data.hpp"

const bool gaia::db::c_is_running_on_server = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these be constexpr, or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. I assumed not, because they're extern, but I didn't try - I'll try now...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't work:

error: constexpr variable declaration must be a definition

Given that we need to separate the definition from the declaration, we need to go with const.

Copy link
Contributor

@senderista senderista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still very confused about the client-side indexes, but this looks good. Looks like there's nothing in your changes that's client-only, just server-only?

Copy link
Contributor

@simone-gaia simone-gaia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@LaurentiuCristofor
Copy link
Contributor Author

Looks like there's nothing in your changes that's client-only, just server-only?

Yes, I don't have something just for client right now. I've just excluded some unnecessary checks from being done on the client.

The next change may involve some client-only changes, but they'll probably depend on other client-side variables, so I may not have to use the new booleans.

BTW, I added two of them, just to avoid having to deal with negations.

@LaurentiuCristofor LaurentiuCristofor merged commit 0c69581 into master Mar 25, 2022
@LaurentiuCristofor LaurentiuCristofor deleted the laur_client_server branch March 25, 2022 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants