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

[data-catalog] create cuttle "readOnlyConnect" method #604

Merged
merged 1 commit into from
Mar 18, 2021

Conversation

manudizandrei
Copy link

In the read only connection, the db lock is bypassed and the transactor is
returned as is.

JIRA: DPT-2819

@manudizandrei manudizandrei requested a review from antonlin1 March 18, 2021 09:34
Copy link
Contributor

@antonlin1 antonlin1 left a comment

Choose a reason for hiding this comment

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

just minor on log-level

def readOnlyConnect(dbConfig: DatabaseConfig)(implicit logger: Logger): XA = {
// FIXME we shouldn't use allocated as it's unsafe instead we have to flatMap on the Resource[HikariTransactor]
val (transactor, _) = newHikariTransactor(dbConfig).allocated.unsafeRunSync
logger.debug("Allocated new read-only Hikari transactor")
Copy link
Contributor

Choose a reason for hiding this comment

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

could we change this to logger.info instead?

Copy link
Author

Choose a reason for hiding this comment

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

sure!

Copy link
Author

Choose a reason for hiding this comment

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

updated it

In the read only connection, the db lock is bypassed and the transactor is
returned as is.

JIRA: DPT-2819
@manudizandrei manudizandrei merged commit 738714d into master Mar 18, 2021
@manudizandrei manudizandrei deleted the readOnlyConnect branch March 18, 2021 09:54
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.

2 participants