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

Feature/housekeeping dataaccess #999

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shinnokdisengir
Copy link
Contributor

@shinnokdisengir shinnokdisengir commented Oct 3, 2024

What this PR does / why we need it:

After porting all realm operations into astarte_dataaccess, housekeeping needs to be refactored using the newest api

NOTE: commit titles will be fixed after other changes

@shinnokdisengir shinnokdisengir force-pushed the feature/housekeeping-dataaccess branch 2 times, most recently from 563f6dd to d512f14 Compare October 3, 2024 14:24
@shinnokdisengir shinnokdisengir marked this pull request as ready for review October 3, 2024 14:25
@@ -72,7 +72,7 @@ defmodule Astarte.Housekeeping.Mixfile do
defp astarte_required_modules(_) do
[
{:astarte_core, github: "astarte-platform/astarte_core"},
{:astarte_data_access, github: "astarte-platform/astarte_data_access"},
{:astarte_data_access, path: "/home/ghio/Documents/astarte_data_access"},
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry!

Copy link
Collaborator

Choose a reason for hiding this comment

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

This change is not related, please remove from this PR

Copy link

codecov bot commented Oct 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.26%. Comparing base (11e9bc6) to head (408a9ab).
Report is 34 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #999      +/-   ##
==========================================
+ Coverage   69.40%   71.26%   +1.85%     
==========================================
  Files         263      249      -14     
  Lines        7119     6312     -807     
==========================================
- Hits         4941     4498     -443     
+ Misses       2178     1814     -364     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -84,7 +85,7 @@ defmodule Astarte.Housekeeping.ReleaseTasks do
end

defp wait_connection_and_check_astarte_keyspace(retries \\ 60) do
case Queries.is_astarte_keyspace_existing() do
case Keyspace.keyspace_existing?("astarte") do
Copy link
Contributor

Choose a reason for hiding this comment

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

could be shortened as

Suggested change
case Keyspace.keyspace_existing?("astarte") do
with {:error, :database_connection_error} <- Keyspace.keyspace_existing?("astarte") do
if retries > 0 do
:timer.sleep(1000)
wait_connection_and_check_astarte_keyspace(retries - 1)
else
{:error, :database_connection_error}
end
end

cause when 'with' can not match, it returns the value (so {:ok, _} or {:error, _})

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