-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mnesia_to_khepri: Check record validity before calling `Mod:copy_to_k…
…hepri/3` [Why] It appears that we get Mnesia write events with the table name and the key, instead of the table name and the written record. The expected event seems to come after. We can't do anything with just the key and we want to skip calls to the callback module in this case. [How] To distinguish the key from the expected record, we first query the table info to get the record name and its arity. Then, we verify the received term against the queried record definition to check if the term is a valid record before calling `Mod:copy_to_khepri/3`.
- Loading branch information
Showing
2 changed files
with
114 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters