-
Notifications
You must be signed in to change notification settings - Fork 0
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
Send timezone country code on create site #591
Send timezone country code on create site #591
Conversation
core/streams/bl/index.js
Outdated
} | ||
// Get timezone and countryCode for Arbimon | ||
const fullStream = { ...stream, ...(await dao.computedAdditions(stream)) } | ||
return sequelize.transaction(async (transaction) => { |
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.
Why do we need transaction here? We only make one action to the database.
If creating on arbimon is failed, you will throw error anyway
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.
you're right. I added it when there were 2 actions there.
core/streams/bl/index.js
Outdated
const externalSite = await arbimonService.createSite(arbimonSite, options.idToken) | ||
fullStream.externalId = externalSite.site_id | ||
} catch (error) { | ||
console.error(`Error creating site in Arbimon (stream: ${fullStream.id})`) |
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.
should we rollback arbimonService.createSite
if we have failed inserting row to the database?
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.
If I remember correctly. we all agree to make it like this and won't rollback the arbimon side even it is failing on Core.
β DoD
(use na when API docs (Release notes, etc) do not need to be updated)
π Summary
timezone
andcountry_code
on create Arbimon site