-
Notifications
You must be signed in to change notification settings - Fork 50
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
refactor(trigger_engine): port query to xandra #837
base: master
Are you sure you want to change the base?
Conversation
test(trigger_engine): await xandra cluster before starting tests Signed-off-by: Francesco Noacco <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #837 +/- ##
==========================================
- Coverage 67.42% 67.36% -0.07%
==========================================
Files 264 264
Lines 6429 6432 +3
==========================================
- Hits 4335 4333 -2
- Misses 2094 2099 +5
|
trigger <- Trigger.decode(trigger_data), | ||
{:ok, action} <- Jason.decode(trigger.action) do | ||
{:ok, action} | ||
else | ||
{:error, :database_connection_error} -> | ||
Logger.warn("Database connection error.") | ||
{:error, %Xandra.ConnectionError{action: action, reason: reason}} -> |
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.
The {:error, %Xandra.Error{}}
case is not handled. It would be good to keep database and logic error (e.g. trigger not found) distinct
if Astarte.Core.Realm.valid_name?(realm_name) do | ||
:ok | ||
else | ||
{:error, :realm_not_found, realm_name} |
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.
I'd say to use a more explicit :invalid_realm_name
atom
apps/astarte_trigger_engine/lib/astarte_trigger_engine/events_consumer.ex
Show resolved
Hide resolved
bd74ded
to
48c8cdc
Compare
6bd7516
to
89a1fc9
Compare
apps/astarte_trigger_engine/lib/astarte_trigger_engine/application.ex
Outdated
Show resolved
Hide resolved
apps/astarte_trigger_engine/lib/astarte_trigger_engine/events_consumer.ex
Outdated
Show resolved
Hide resolved
apps/astarte_trigger_engine/lib/astarte_trigger_engine/events_consumer.ex
Outdated
Show resolved
Hide resolved
apps/astarte_trigger_engine/lib/astarte_trigger_engine/config.ex
Outdated
Show resolved
Hide resolved
apps/astarte_trigger_engine/lib/astarte_trigger_engine/events_consumer.ex
Show resolved
Hide resolved
89a1fc9
to
3bfab10
Compare
feat(trigger_engine): tag connection_error log Signed-off-by: Francesco Noacco <[email protected]>
3bfab10
to
71f8dd1
Compare
yes there was only one query
closes #459