Skip to content

Commit

Permalink
fix: when an atomic update is fully skipped, run the query if it coul…
Browse files Browse the repository at this point in the history
…d produce errors
  • Loading branch information
zachdaniel committed Oct 23, 2024
1 parent 1228fcd commit 0570dcc
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ Welcome! `AshPostgres` is the PostgreSQL data layer for [Ash Framework](https://

## Reference

- [AshPostgres.DataLayer DSL](documentation/dsls/DSL:-AshPostgres.DataLayer.md)
- [AshPostgres.DataLayer DSL](documentation/dsls/DSL-AshPostgres.DataLayer.md)
4 changes: 2 additions & 2 deletions lib/migration_compile_cache.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ defmodule AshPostgres.MigrationCompileCache do
Compile a file, caching the result for future calls.
"""
def compile_file(file) do
Agent.get_and_update(__MODULE__, fn state ->
Agent.get_and_update(__MODULE__, fn state ->
new_state = ensure_compiled(state, file)
{Map.get(new_state, file), new_state}
end)
Expand All @@ -30,9 +30,9 @@ defmodule AshPostgres.MigrationCompileCache do
nil ->
compiled = Code.compile_file(file)
Map.put(state, file, compiled)

_ ->
state
end
end

end
2 changes: 1 addition & 1 deletion lib/multitenancy.ex
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ defmodule AshPostgres.MultiTenancy do
"file #{Path.relative_to_cwd(file)} does not define an Ecto.Migration"
end
end

defp compile_file(file) do
AshPostgres.MigrationCompileCache.start_link()
AshPostgres.MigrationCompileCache.compile_file(file)
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ defmodule AshPostgres.MixProject do
"documentation/topics/advanced/expressions.md",
"documentation/topics/advanced/schema-based-multitenancy.md",
"documentation/topics/advanced/manual-relationships.md",
"documentation/dsls/DSL:-AshPostgres.DataLayer.md",
"documentation/dsls/DSL-AshPostgres.DataLayer.md",
"CHANGELOG.md"
],
groups_for_extras: [
Expand Down

0 comments on commit 0570dcc

Please sign in to comment.