Skip to content

Commit 7603cae

Browse files
authored
Merge pull request #89 from beardedeagle/0.3.12
Use table_load_timeout for get_table_cookies
2 parents e0ce918 + 3933dcd commit 7603cae

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [[0.3.11]] - 2023-05-04
8-
### ADDED
7+
## [[0.3.12]] - 2023-05-06
8+
### Changed
9+
- Changed `get_table_cookies/1` and `get_table_cookies/2` to utilize `table_load_timeout/0` for `:rpc.call/5` calls.
10+
11+
## [[0.3.11]] - 2023-05-06
12+
### Added
913
- Added test to ensure `get_table_cookies/1` returns error when node is not reachable.
1014

1115
### Fixed
@@ -17,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1721
- Updated dependencies.
1822
- Updated GitHub repo files.
1923

20-
### FIXED
24+
### Fixed
2125
- Updated `get_table_cookies/1` to use `:local_tables` instead of `:tables` to properly identify table copies that don't exist locally to a given node, closes #84.
2226

2327
## [[0.3.9]] - 2021-02-21
@@ -108,6 +112,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
108112
### Added
109113
- Initial release.
110114

115+
[0.3.12]: https://github.com/beardedeagle/mnesiac/compare/v0.3.11...v0.3.12
111116
[0.3.11]: https://github.com/beardedeagle/mnesiac/compare/v0.3.10...v0.3.11
112117
[0.3.10]: https://github.com/beardedeagle/mnesiac/compare/v0.3.9...v0.3.10
113118
[0.3.9]: https://github.com/beardedeagle/mnesiac/compare/v0.3.8...v0.3.9

lib/mnesiac/store_manager.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ defmodule Mnesiac.StoreManager do
126126
This function returns a map of tables and their cookies.
127127
"""
128128
def get_table_cookies(node \\ node()) do
129-
case :rpc.call(node, :mnesia, :system_info, [:local_tables], 5_000) do
129+
case :rpc.call(node, :mnesia, :system_info, [:local_tables], table_load_timeout()) do
130130
{:badrpc, reason} ->
131131
{:error, reason}
132132

@@ -137,7 +137,7 @@ defmodule Mnesiac.StoreManager do
137137

138138
defp get_table_cookies(node, tables) do
139139
Enum.reduce_while(tables, {:ok, %{}}, fn table, {:ok, acc} ->
140-
case :rpc.call(node, :mnesia, :table_info, [table, :cookie], 5_000) do
140+
case :rpc.call(node, :mnesia, :table_info, [table, :cookie], table_load_timeout()) do
141141
{:badrpc, reason} ->
142142
{:halt, {:error, reason}}
143143

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defmodule Mnesiac.MixProject do
66
def project do
77
[
88
app: :mnesiac,
9-
version: "0.3.11",
9+
version: "0.3.12",
1010
elixir: "~> 1.8",
1111
elixirc_paths: elixirc_paths(Mix.env()),
1212
test_coverage: [tool: ExCoveralls],

0 commit comments

Comments
 (0)